One line of code causing problem

neilmcmor

Registered User.
Local time
Today, 13:26
Joined
Aug 9, 2007
Messages
70
Can anyone help with this little bit of code. I have a module that exports data from Access to Excel. The following line is causing me problems. I am trying to divide a value on one sheet on the Excel book with a value on another sheet of the same workbook.

oSheet.Cells(intRow, 2).Formula = "=A" & intRow & "/oSheet.Classes.Range C34"

oSheet.Cells(intRow, 2).NumberFormat = "0.00%"
 
oSheet.Cells(intRow, 2).Formula = "=A" & intRow & "/oSheet.Classes.Range C34"

Not sure what you're trying to achieve there but this would be a good start:

oSheet.Cells(intRow, 2).Formula = "=A" & intRow & "/" & OtherSheetName & "!C34"

Pete
 
Thanks Pete. How do I declare the other sheet at the start on the module?
 

Users who are viewing this thread

Back
Top Bottom