My question is pretty basic, really. What is the syntax to change the cell number format using an excel worksheet object through VBA?
For example, I have a column that I need to change from the "General" number format to a "Text" number format. Right now, this is the line...
That would be great, Doug. Here's my email address:
cope22@hotmail.com
I was thinking that I might have to do something like what you're suggesting, but was dreading it because I have little experience with the Excel object in VBA. But hey, you live, you learn.
Thanks so much.
cope22
If you are just trying to reference the value that has been chosen in the combo box, do this:
CusNo = Me.Customer.Value
You could possibly do the same with the following:
CusNo = Me.Customer.Column(0)
(leave out the .Value in this case)
Basically, if you only have one column in your combo...
Use the .Value property on the control you are referencing. For example:
Sample = Forms!SampleForm.SampleControl.Value
Hopefully this should help you.
cope22
Thanks for your reply, but unfortunately the Recordset.Source property didn't work. I think that the function is having a problem because I'm not actually specifying the name of an existing table or query object. Maybe there's another function I should be using...?
I'll keep poking at it...
I have an SQL string that generates an ADO recordset, and I need to export the contents of that recordset to an Excel spread sheet. I've messed around with using the DoCmd.TransferSpreadsheet function:
DoCmd.TransferSpreadsheet acExport, acSpreadsheetTypeExcel9, rsRecordset, filename, True...
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.