Excel - Deleting A COLUMN BY MACRO
Asked By satish_vemur on 05-Aug-12 05:38 PM
HI all,
every month i geenrate reports. from ms-access i export the reports to
excel. i have various colmns which i dont requier. i need to delete them
manually.
the columns are random.
From A - Z columns the data is filled. most of the columns i dont
requier. by using a macro can i deleted these unwanted columns.
how i can do this. my desk is full load of work.i am new to excel to.
can some one please help me in this regards.
i am great ful to all.
Thanks
VEN
--
satish_vemuri@hotmail.com
Ron Rosenfeld replied to satish_vemur on 06-Aug-12 06:35 AM
Do you want to delete the entire column, or just the contents of the column?
Are the columns to be deleted the same each month, or are they truly random and change each month?
If the latter, how do you know which one's to delete?
satish_vemur replied to satish_vemur on 06-Aug-12 11:00 AM
--
satish_vemuri@hotmail.com
Ron Rosenfeld replied to satish_vemur on 08-Aug-12 08:47 PM
Exactly which columns do you need to delete?
Cimjet replied to satish_vemur on 10-Aug-12 08:54 AM
Hi
Your not replying to Ron
So this will delete columns, you can edit or add to it.
You could record a macro for what you want or we are not getting the question right.
A reply from you would be good
Regards
Cimjet
Cimjet replied to Cimjet on 10-Aug-12 09:02 AM
Forgot to post the code:
Sub DeleteColumn()
Range("A:A,C:C,E:E,H:H").Select
Selection.Delete Shift:=xlToLeft
End Sub
Cimjet replied to Cimjet on 10-Aug-12 09:07 AM
I wish we could edit are post but anyway, here is a one line that will do the same.
Sub DeleteColumn()
Range("A:A,C:C,E:E,H:H").Delete Shift:=xlToLeft
End Sub
Don't need to select the columns
Cimjet