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 wOOdy-Soft on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Program for Deleting spreadsheet columns

Status
Not open for further replies.

itpmguy

Programmer
Apr 25, 2002
31
US
Hello,
I have a spreadsheet with more than 600 sheets. I want to delete all columns starting from column "G". The last column is column "R". How do I do this in VBscript? Any suggestions are greatly appreciated.
Thanks


Cheap Computer Part Supply Buying Tips
VOIP Phone Service Guide
 
Switch on record in excel. Select and delete the columns from G to R and stop recording. Have a look at the macro generated. That is the basic bit. You have to get rid of is the type declarations and it is more or less VBScript.

You then add something like
Code:
dim excel
set excel = CreateObject("Excel.Application")
with excel
...
at the start and
Code:
end with
excel.Quit
set excel = nothing
at the end.
 
Thanks. It works and some cleanup may be needed.

Here's another question -

Is there any way I can copy columns "A" through "E" from all the sheets and put it into a Microsoft Word document in a table format. It should name the Word doc table name as the name of the corresponding sheet in spreadsheet.

Any help is appreciated.

Thanks


Cheap Computer Part Supply Buying Tips
VOIP Phone Service Guide
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top