mike.lewis
Board Regular
- Joined
- Nov 29, 2009
- Messages
- 196
Hey There
i have a coded cell where when it is selected the template worksheet performs a save as process
The file currently saves as the below:
Value from cell A _ Value from Cell B _ Todays Date _ Value from cell c
This in theory may look like the following:
Mike Jones_Krystal Mary_15.03.2011_89.39382712612
I am having a couple of issues
'/// Do the following if A1 is the cell selected (change that to suit...)
If Not Intersect(Target, Range("B1")) Is Nothing Then
Dim s As String
Dim x As Variant
s = Range("C6") & "_" & Range("C5") & "_" & Format(Date, "dd.mm.yy") & "_" & Range("E5") & ".xls"
x = Application.GetSaveAsFilename(s, _
"Microsoft Office Excel Workbook(*.xls), *.xls") '///Alert: hardcoded for XL2003
If x <> False Then
ActiveWorkbook.SaveAs s
End If
End If
i have a coded cell where when it is selected the template worksheet performs a save as process
The file currently saves as the below:
Value from cell A _ Value from Cell B _ Todays Date _ Value from cell c
This in theory may look like the following:
Mike Jones_Krystal Mary_15.03.2011_89.39382712612
I am having a couple of issues
- The file name that is auto generated will be edited to reduce the numbers at the end to two decimal spaces, therefore being 89.39, as the rest are generally not needed, i have not found i way of having this done automatically yet
- When the file name is edited in the Save As field that is presented to reflect the number that is needed, the file name automatically reverts back to its original name even if the Save As field is editedMike Jones_Krystal Mary_15.03.2011_89.39382712612
'/// Do the following if A1 is the cell selected (change that to suit...)
If Not Intersect(Target, Range("B1")) Is Nothing Then
Dim s As String
Dim x As Variant
s = Range("C6") & "_" & Range("C5") & "_" & Format(Date, "dd.mm.yy") & "_" & Range("E5") & ".xls"
x = Application.GetSaveAsFilename(s, _
"Microsoft Office Excel Workbook(*.xls), *.xls") '///Alert: hardcoded for XL2003
If x <> False Then
ActiveWorkbook.SaveAs s
End If
End If