jamescooper
Well-known Member
- Joined
- Sep 8, 2014
- Messages
- 840
Hello, how do I ensure myValue when entered in the inputbox in the first sub below, carries through to the section without being asked again?
Many thanks.
Many thanks.
Code:
Sub D42_Forecast_Macro()
Dim myValue As Variant
myValue = InputBox("Enter the railway period, e.g. 1804")
End Sub
Code:
Public Sub Copy_Cells(myValue As String)
InputBox myValue
Dim destcell As Range, r As Long
Dim fileSpec As String, folderPath As String, fileName As String
cellValue1 = Workbooks("Forecast v.s. D42 Statement Template.xlsx").Sheets("Revenue").Range("U6")
fileSpec = "C:\Users\jamesco\OneDrive for Business\PMO - Schedule 4 - Sharing best practice\2. CrossCountry Trains\Revenue\" & myValue & "\" & cellValue1 & ""
End Sub