I have input boxes that I use to input the selection data that I want (numbers/dates).
My macro opens the template that corresponds to my selection, then saves the file as Date_Block.xls.
The problem that I am running into is that when i do a type conversion to convert my number to a string so that I can use it in a filename, it adds a space to the beginning of the data.
I.E. If I have "SS = 1", then I convert it, it comes out " 1".
Is there a simple way to have it not add the space? Or a simple way to eliminate it? I could add a case structure that would set the string based on the number, but it would have ~60 cases.
Here is the code I am using:
-------------------------------------
Sub Run_Access_Macro()
Dim Sensor As String
Dim StartDate As String
Dim EndDate As String
Dim Block As String
Dim File As String
Dim Template As String
Dim B As Double
Dim S As Double
Dim SS As Double
Dim ES As Double
'Prompt for Block, StartDate, and EndDate
B = InputBox("Please enter block number:", "Access Query")
StartDate = InputBox("Please enter Start Date:", "Access Query")
EndDate = InputBox("Please enter End Date:", "Access Query")
Block = Str(B)
'Set Filename and Template
File = StartDate + "_" + Block + ".xls"
Template = "Template_" + Block + ".xls"
'Open Template
Workbooks.Open Filename:="C:\Life_Test\" + Template
...........
End Sub