I have developed a workbook that has data with various VLOOKUP's etc. I then have developed a simple Macro that copies the page, openes a new workbook, names the workbook by cell C5 in the original workbook.
For your interest the macro is this:
Sub Res()
Dim n As String
n = ThisWorkbook.Path & "\" & Sheets("Sheet1").Range("C5").Value & ".xlsx"
Workbooks.Add
ActiveWorkbook.SaveAs n
ThisWorkbook.Sheets("Sheet1").UsedRange.Copy
ActiveWorkbook.Sheets("Sheet1").Range("A1").PasteSpecial xlPasteValuesAndNumberFormats
End Sub
This works well, but now what I would like to do is have a macro that I can run just prior to running the above mentioned macro, that will put a 5 digit (say 10000) into cell C5 of the worksheet. The next time I open the original workbook I need to see the old number (ie. 10000) I then do a whole lot of work on the worksheet and I need then to run the macro to put in the next sequential number (eg 10001), before running the macro which develops the new workbook.
Basically a sequential number question.
Any suggestions?
Thanks
Rob
Edit: Joe4 logged in as Rob_Sobey and posted (copied this question from his post in About This Board
For your interest the macro is this:
Sub Res()
Dim n As String
n = ThisWorkbook.Path & "\" & Sheets("Sheet1").Range("C5").Value & ".xlsx"
Workbooks.Add
ActiveWorkbook.SaveAs n
ThisWorkbook.Sheets("Sheet1").UsedRange.Copy
ActiveWorkbook.Sheets("Sheet1").Range("A1").PasteSpecial xlPasteValuesAndNumberFormats
End Sub
This works well, but now what I would like to do is have a macro that I can run just prior to running the above mentioned macro, that will put a 5 digit (say 10000) into cell C5 of the worksheet. The next time I open the original workbook I need to see the old number (ie. 10000) I then do a whole lot of work on the worksheet and I need then to run the macro to put in the next sequential number (eg 10001), before running the macro which develops the new workbook.
Basically a sequential number question.
Any suggestions?
Thanks
Rob
Edit: Joe4 logged in as Rob_Sobey and posted (copied this question from his post in About This Board