Hi,
Having cobbled together the following I'm snagged on how to move a sheet in the active workbook to another open workbook which I do not want to explicitly type the name of.
'Move sheet to target book
ActiveSheet.Move Before:=Workbooks(XXX).Sheets(1)
Where XXX on other forums can be substituted for "filename.xls", I want to be able to define a variable to use there. The reason is elsewhere in the code I use this:
sFileName = Application.GetOpenFilename
to choose a file, then this:
Me.TextBox2.Value = sFileName
to display it in a text box. I then open the file displayed in textbox2.
I want to make it so that I can replace XXX with the filename in TextBox2 and have the macro copy the active sheet to it!
Thanks in advance.
Tom
Having cobbled together the following I'm snagged on how to move a sheet in the active workbook to another open workbook which I do not want to explicitly type the name of.
'Move sheet to target book
ActiveSheet.Move Before:=Workbooks(XXX).Sheets(1)
Where XXX on other forums can be substituted for "filename.xls", I want to be able to define a variable to use there. The reason is elsewhere in the code I use this:
sFileName = Application.GetOpenFilename
to choose a file, then this:
Me.TextBox2.Value = sFileName
to display it in a text box. I then open the file displayed in textbox2.
I want to make it so that I can replace XXX with the filename in TextBox2 and have the macro copy the active sheet to it!
Thanks in advance.
Tom