Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Excel: Save Output as new file without macro

Status
Not open for further replies.

Eytch

Programmer
Jan 29, 2003
60
0
0
US
How do you copy the output generated by an Excel macro to a new file without including the macro that generated the output?

Thanks,
Lakefish
 
In reply to your post y'day I indicated how you could move your results sheet to a new workbook. If you want to copy instead then substitute "copy" for "move" but this will not work if any of your cells have more than 255 characters.

Skip and Gerry indicated that you can save / create your macro in your personal workbook, (or just any other workbook).

This will enter values in a specific workbook and worksheet
Code:
Sub Macro3()
Workbooks("Book2").Worksheets("SHEET1").Range("B15:D18").FormulaR1C1 = "Hi"
End Sub
If you record yourself doing the same thing you will get similar code but with lots of activate and select statements that are not in fact necessary

Other Tips:
ThisWorkbook always means the workbook where the vba code is.
ActiveWorkbook will be the workbook you are using immediately prior to initiating the macro (although the macro could well change the active workbook).

Hope this gets you going. If not then be more specific about what your code is doing.



Gavin
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top