Hi everyone,
I managed to get a few things done but now I have a subscript range error:
Sub Test()
'
' Test Macro
'
Set NewBook = Workbooks.Add
Do
fName = Application.GetSaveAsFilename
Loop Until fName <> False
NewBook.SaveAs Filename:=fName
Cells.Select
With Selection.Interior
.Pattern = xlSolid
.PatternColorIndex = xlAutomatic
.ThemeColor = xlThemeColorDark1
.TintAndShade = -0.349986266670736
.PatternTintAndShade = 0
End With
Windows("Example Inventory Macro.xlsm").Activate
Range("B1:D19,G1:H19").Select
Range("G1").Activate
Selection.Copy
Windows("Book1").Activate
Range("B17").Select
ActiveSheet.Paste
Range("B19:F35").Select
Application.CutCopyMode = False
Selection.Copy
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
:=False, Transpose:=False
Columns("B:F").Select
Range("B13").Activate
Columns("B:F").EntireColumn.AutoFit
Rows("16:16").Select
ActiveWindow.FreezePanes = True
Windows("Example Inventory Macro.xlsm").Activate
Sheets("Graph").Select
ActiveSheet.ChartObjects("Chart 1").Activate
Application.CutCopyMode = False
ActiveChart.ChartArea.Copy
Windows("Book3").Activate
ActiveSheet.PasteSpecial Format:="Bitmap", Link:=False, DisplayAsIcon:= _
False
End Sub
I assume it is because Windows("Book1").Activate does not refer to the actual file I have just saved but I don't know how to make it capture the file name I just entered.
The rest of the code seems to be reasonably ok (still working through a few things) if I have a file with the appropriate name but I need to find a work around.
Any guess from anyone?
Thanks,
S
Bookmarks