halshion
New Member
- Joined
- Jan 9, 2023
- Messages
- 16
- Office Version
- 2013
- Platform
- Windows
Hello again everyone,
I want to encode the textbox values to all worksheets so I made a code, sourced from the net, modified slightly for my taste. Does not display an error but it doesnt do anything.
what may seems to be the prblem?
I want to encode the textbox values to all worksheets so I made a code, sourced from the net, modified slightly for my taste. Does not display an error but it doesnt do anything.
what may seems to be the prblem?
VBA Code:
Set wb = Workbooks(Machine1.Value & ".xlsx")
wb.Activate
For Each ws In wb.Sheets
'inserts start and date end values to range M4 and R4
range("M4").Value = CDate(DateFrom.Value)
range("R4").Value = CDate(DateTo.Value)
datStartDate = range("M4").Value
datEndDate = range("R4").Value
lngStartDate = datStartDate
lngEndDate = datEndDate
Dim i As Date 'autofills date start to end using loop
For i = 0 To (lngEndDate - lngStartDate)
Cells(i + 3, 40).Offset(5 * i, 0) = lngStartDate + i
Next i
Next ws