ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Worksheet Functions (https://www.excelbanter.com/excel-worksheet-functions/)
-   -   VB to erase 2 Columns from every sheet (https://www.excelbanter.com/excel-worksheet-functions/7315-vbulletin-erase-2-columns-every-sheet.html)

Kevin M

VB to erase 2 Columns from every sheet
 
Hi all, TIA..

I have a sheet here with erroneous data on every F, G,
and H column in 115 sheets labeled Dec 4 - Mar 31. Can
someone help with the VB to highlight and delete these
three columns in the affected sheets?

Thanks!

Kevin M

Paul B

Kevin, this macro will delete columns F:H in ALL worksheets in the workbook

Sub Delete_Columns_F_G_H()
Dim ws As Worksheet
For Each ws In ThisWorkbook.Worksheets
ws.Columns("F:H").Delete Shift:=xlToLeft
Next ws
End Sub

--
Paul B
Always backup your data before trying something new
Please post any response to the newsgroups so others can benefit from it
Feedback on answers is always appreciated!
Using Excel 2002 & 2003

"Kevin M" wrote in message
...
Hi all, TIA..

I have a sheet here with erroneous data on every F, G,
and H column in 115 sheets labeled Dec 4 - Mar 31. Can
someone help with the VB to highlight and delete these
three columns in the affected sheets?

Thanks!

Kevin M




Kevin M

Thanks Paul, i'll give it a spin. :-)

Kevin M

-----Original Message-----
Kevin, this macro will delete columns F:H in ALL

worksheets in the workbook

Sub Delete_Columns_F_G_H()
Dim ws As Worksheet
For Each ws In ThisWorkbook.Worksheets
ws.Columns("F:H").Delete Shift:=xlToLeft
Next ws
End Sub

--
Paul B
Always backup your data before trying something new
Please post any response to the newsgroups so others can

benefit from it
Feedback on answers is always appreciated!
Using Excel 2002 & 2003

"Kevin M"

wrote in message
...
Hi all, TIA..

I have a sheet here with erroneous data on every F, G,
and H column in 115 sheets labeled Dec 4 - Mar 31. Can
someone help with the VB to highlight and delete these
three columns in the affected sheets?

Thanks!

Kevin M



.



All times are GMT +1. The time now is 02:45 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
ExcelBanter.com