Hi everyone, first time poster (as many people who are at their wit's end are, I'm sure) here. I did a search for the problem I'm having, but from the posts I found, it's kind of a vague problem, so I didn't really find a solution to what I'm having problems with. I'll give a quick rundown of what I'm trying to do, then a quick rundown of the code, then, uh, the floor is yours.
Basically, I've got a workbook with three sheets in it. One of the sheets has a lot of stuff that is dependant on information put into another sheet. For example, customer name, different quantities ordered, measurements, etc. The second sheet does calculations on that, and makes a "customer info"/"work order" type sheet. My task is to create a "Save" button that takes the second sheet, copies it into a new workbook, and saves it as one of the field names. It needs to be just the data/formatting copied over, and JUST that one sheet.
I'm also to have the original file (the one that has the Save button) clear the first sheet, where the data gets entered, not calculated.
So. Here's my entire code for the Save button. It's probably horribly sloppy and completely inefficient, but hey, that's why I'm posting here, right?
Private Sub cmdSave_Click()
Dim SavePath As String
Dim SaveFile As String
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
Selection.PasteSpecial Paste:=xlPasteFormats, Operation:=xlNone, _
Application.CutCopyMode = False
Sheets("Sheet1").Name = "Procedures"
SavePath = "N:\Procedures\Customer Info\"
SaveFile = Range("G1")
ActiveWorkbook.SaveAs (SavePath & SaveFile & ".xls")
The problem appears with the bolded line. I'm not sure why, as when I created a macro, and ran through this step by step, that's what I got.