Macro help please

N

Neil Holden

Hello, i have a master excel template which users go in and save as when
completed.

Proposed macro - I want to create a macro for when pressed -

Save as a different excel sheet to a specific location and then hide
relevant columns and save the file as another name to a specific location.

I have tried to record a macro to do this but is doesnt work.

Help will be appreciated!!

Neil.

Please help.
 
J

Jacob Skaria

Sub Macro()

ThisWorkbook.SaveCopyAs "c:\temp\" & "1.xls"
With ThisWorkbook.Worksheets("Sheet1")
Columns("B:B").EntireColumn.Hidden = True
Columns("D:D").EntireColumn.Hidden = True
End With
ThisWorkbook.SaveCopyAs "c:\temp\" & "2.xls"
End Sub


If this post helps click Yes
 
D

Dave Peterson

Typo alert. The dots before the Columns() was lost:

Sub Macro()
ThisWorkbook.SaveCopyAs "c:\temp\" & "1.xls"
With ThisWorkbook.Worksheets("Sheet1")
.Columns("B:B").EntireColumn.Hidden = True
.Columns("D:D").EntireColumn.Hidden = True
End With
ThisWorkbook.SaveCopyAs "c:\temp\" & "2.xls"
End Sub
 
N

Neil Holden

Hi thanks for that, i have got the hiding columns working fine, but i don't
want an excel name saving i want the user to type the name of the file?

Thanks again for your help.

Neil.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top