Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Hi,
I am writing a macro in which I need to do the following: Here I am passing the Sheet name as an argument to the macro. If I replace the sheet name (Sheet1) with the variable (strSheetName), it dosen't work Actual: -------- ActiveCell.FormulaR1C1 = _ "=DATEVALUE(LEFT(RIGHT(""0""&Sheet1!RC2,8),2)& ""/""&MID(RIGHT(""0""&Sheet1!RC2,8),3,2)&""/""&RIGHT(Sheet1!RC2,4))" Changed: ----------- ActiveCell.FormulaR1C1 = _ "=DATEVALUE(LEFT(RIGHT(""0""&strSheetName!RC2,8),2 )&""/""&MID(RIGHT(""0""&strSheetName!RC2,8),3,2)&""/""&RIGHT(strSheetName!RC2,4))" I tried to use the String Editor Add-in that gets packaged with VBA, unfortunately I do not have it. Could you please, let me know when I'm going wrong. Thanks in advance. |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
formatting of numbers within a string | Excel Worksheet Functions | |||
Hiding an SQL connection string in an Excel macro | Excel Programming | |||
Excel VBA to search all macro code in Excel module for specific string criteria | Excel Programming | |||
Special string formatting | Excel Programming | |||
Use Word VBA string in Excel macro? | Excel Programming |