By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
424,510 Members | 1,497 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 424,510 IT Pros & Developers. It's quick & easy.

format a column in excel from Access using VB

P: 11
I need to format a column in excel but would like to do it from Access using VB. I have hacked around and found a few ways to get to the workbook but have a problem getting to the sheet i want. But, how do i format a cell in excel from Access using VB? I have most of my vb code in access but i am running into some formatting difficulties on the excel side and want to keep all my code under Access. Thanks.
Jul 16 '07 #1
Share this Question
Share on Google+
3 Replies


ADezii
Expert 5K+
P: 8,602
I need to format a column in excel but would like to do it from Access using VB. I have hacked around and found a few ways to get to the workbook but have a problem getting to the sheet i want. But, how do i format a cell in excel from Access using VB? I have most of my vb code in access but i am running into some formatting difficulties on the excel side and want to keep all my code under Access. Thanks.
You would use Automation code to create an Instance of Excel, make a specific Worksheet the active Sheet, then apply direct formatting to a Column in the Worksheet by using VBA code from within Access. I'm going to bed now, but if you need further assistance on this Topic, please let us know. Either a Moderator, Expert, another User, or myself will get back to you in due time.
Jul 17 '07 #2

Expert 100+
P: 634
I have hacked around and found a few ways to get to the workbook but have a problem getting to the sheet i want. But, how do i format a cell in excel from Access using VB?.
Assuming you have opened Excel and the workbook using Automation then this formats a column

oExcel.Sheets("SheetName").Columns("A").NumberForm at = "dd/mm/yy"

Where oExcel is the Excel Application object.

Does that help?

This is the base essential, it depend what you are doing, but if you are using this (or any other sheet) to do a significant amout, then you can make the sheet the acative sheet or set the sheet to and object variable or use the With constuct to refer to it.


MTB
Jul 17 '07 #3

P: 11
Thanks to all who offered suggestions. I may not be able to get back to you until this weekend,as it is not my main project. As soon as i get to work on it i will let you folks know my results.
Jul 17 '07 #4

Post your reply

Sign in to post your reply or Sign up for a free account.