LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 16
Default Excel Macro string formatting

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
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
formatting of numbers within a string Edward Excel Worksheet Functions 8 November 1st 07 08:13 PM
Hiding an SQL connection string in an Excel macro Bob Smith[_2_] Excel Programming 2 November 18th 04 09:37 AM
Excel VBA to search all macro code in Excel module for specific string criteria Roger1947 Excel Programming 0 May 19th 04 05:51 PM
Special string formatting christobal[_4_] Excel Programming 6 April 19th 04 05:46 PM
Use Word VBA string in Excel macro? Ed[_9_] Excel Programming 2 January 12th 04 05:18 PM


All times are GMT +1. The time now is 01:32 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"