The basic premise is that I have four data sets that I want the macro to place into various spots in each file I run it on. For example:
'013125
1/31/25
1/1/25
2/1/25
These items are located in cell B7-B10 of the workbook containing the macros. I used the macro to designate each of these items as "NDA" to "NDD". The last 3 work fine, but the first item continuously drops the leading zero. If possible, I'd like to the target location for NDA to contain the full text of the source, including the apostrophe and the zero.
Here's the code I was using:
'013125
1/31/25
1/1/25
2/1/25
These items are located in cell B7-B10 of the workbook containing the macros. I used the macro to designate each of these items as "NDA" to "NDD". The last 3 work fine, but the first item continuously drops the leading zero. If possible, I'd like to the target location for NDA to contain the full text of the source, including the apostrophe and the zero.
Here's the code I was using:
VBA Code:
Sub DateUpdate()
CM = ThisWorkbook.Worksheets("Main").Range("B5")
Dim wbkdata As Workbook
NDA = ThisWorkbook.Worksheets("Main").Range("B7")
NDB = ThisWorkbook.Worksheets("Main").Range("B8")
NDC = ThisWorkbook.Worksheets("Main").Range("B9")
NDD = ThisWorkbook.Worksheets("Main").Range("B10")
Sheets("JE").Activate
ActiveSheet.Range("C5") = NDA
Sheets("BS Reserves").Activate
ActiveSheet.Range("A2") = NDB
XRow = WorksheetFunction.Match("Change Monthly", Range("A:A"), 0)
ActiveSheet.Range("A" & XRow + 1) = NDC
ActiveSheet.Range("A" & XRow + 2) = NDD
End Sub