For an invoicing spreadsheet, I want a macro assigned to a button that will print an invoice, update 2 sheets of data with what was invoiced and copy and rename these updated sheets with the invoice number.
I think I have it all figured out EXCEPT how to get the naming of these sheets. I found some code online that goes like this:
Private Sub Workbook_SheetChange(ByVal Sh As Object, ByVal Target As Range)
If Target.Address = "$A$1" Then Sh.Name = Target
End Sub
(found here:http://www.mrexcel.com/td0123.html)
I can't seem to get this code to work. In VB editor, I've pasted this in, but either get no results, "argument not optional" errors...basically not the result I want.
How can I get this code to work? Also, anticipating this macro to be run several times, is there going to be a problem with previously generated worksheets getting renamed?
Hope I made myself understood. And any good recomendations for a poor student looking to teach themselves more on VBA?
Thank you!
Bookmarks