Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Delete column if ....
Thanks for the response... one more basic question:
What if I am moving and formatting the data first, then I want to delete these columns.... How/where do I place this? "Tom Ogilvy" wrote: Dim lastcol as Long, i as Long lastcol = cells(10,256).End(xlToLeft).Column for i = lastcol to 1 step -1 if isnumeric(cells(10,i)) then if cells(10,i) < 1 then columns(i).Delete end if end if Next -- Regards, Tom Ogilvy "JEFF" wrote in message ... Hi, I'd like to have my VBA delete those columns where the cell content of row 10 of that same column <1.... Help?! TIA |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
Delete column if ....
It would really be hard to say without knowing exactly what the situation
is. -- Regards, Tom Ogilvy "JEFF" wrote in message ... Thanks for the response... one more basic question: What if I am moving and formatting the data first, then I want to delete these columns.... How/where do I place this? "Tom Ogilvy" wrote: Dim lastcol as Long, i as Long lastcol = cells(10,256).End(xlToLeft).Column for i = lastcol to 1 step -1 if isnumeric(cells(10,i)) then if cells(10,i) < 1 then columns(i).Delete end if end if Next -- Regards, Tom Ogilvy "JEFF" wrote in message ... Hi, I'd like to have my VBA delete those columns where the cell content of row 10 of that same column <1.... Help?! TIA |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
Delete column if ....
Sorry.... I start with some flat data, move it around and reformat (did it
manually while recording the macro). At this point, I would then like to delete the columns fitting the criteria below... Does that help? "Tom Ogilvy" wrote: It would really be hard to say without knowing exactly what the situation is. -- Regards, Tom Ogilvy "JEFF" wrote in message ... Thanks for the response... one more basic question: What if I am moving and formatting the data first, then I want to delete these columns.... How/where do I place this? "Tom Ogilvy" wrote: Dim lastcol as Long, i as Long lastcol = cells(10,256).End(xlToLeft).Column for i = lastcol to 1 step -1 if isnumeric(cells(10,i)) then if cells(10,i) < 1 then columns(i).Delete end if end if Next -- Regards, Tom Ogilvy "JEFF" wrote in message ... Hi, I'd like to have my VBA delete those columns where the cell content of row 10 of that same column <1.... Help?! TIA |
#4
Posted to microsoft.public.excel.programming
|
|||
|
|||
Delete column if ....
Sub CreateandMoveDate()
Dim lastcol as Long, i as Long ' current code ' activatesheet where you want to delete data ' for illustration, assume it is named "data" worksheets("Data").Activate lastcol = cells(10,256).End(xlToLeft).Column for i = lastcol to 1 step -1 if isnumeric(cells(10,i)) then if cells(10,i) < 1 then columns(i).Delete end if end if Next i End Sub would be my guess -- "JEFF" wrote in message ... Sorry.... I start with some flat data, move it around and reformat (did it manually while recording the macro). At this point, I would then like to delete the columns fitting the criteria below... Does that help? "Tom Ogilvy" wrote: It would really be hard to say without knowing exactly what the situation is. -- Regards, Tom Ogilvy "JEFF" wrote in message ... Thanks for the response... one more basic question: What if I am moving and formatting the data first, then I want to delete these columns.... How/where do I place this? "Tom Ogilvy" wrote: Dim lastcol as Long, i as Long lastcol = cells(10,256).End(xlToLeft).Column for i = lastcol to 1 step -1 if isnumeric(cells(10,i)) then if cells(10,i) < 1 then columns(i).Delete end if end if Next -- Regards, Tom Ogilvy "JEFF" wrote in message ... Hi, I'd like to have my VBA delete those columns where the cell content of row 10 of that same column <1.... Help?! TIA |
#5
Posted to microsoft.public.excel.programming
|
|||
|
|||
Delete column if ....
PERFECT!
"Tom Ogilvy" wrote: Sub CreateandMoveDate() Dim lastcol as Long, i as Long ' current code ' activatesheet where you want to delete data ' for illustration, assume it is named "data" worksheets("Data").Activate lastcol = cells(10,256).End(xlToLeft).Column for i = lastcol to 1 step -1 if isnumeric(cells(10,i)) then if cells(10,i) < 1 then columns(i).Delete end if end if Next i End Sub would be my guess -- "JEFF" wrote in message ... Sorry.... I start with some flat data, move it around and reformat (did it manually while recording the macro). At this point, I would then like to delete the columns fitting the criteria below... Does that help? "Tom Ogilvy" wrote: It would really be hard to say without knowing exactly what the situation is. -- Regards, Tom Ogilvy "JEFF" wrote in message ... Thanks for the response... one more basic question: What if I am moving and formatting the data first, then I want to delete these columns.... How/where do I place this? "Tom Ogilvy" wrote: Dim lastcol as Long, i as Long lastcol = cells(10,256).End(xlToLeft).Column for i = lastcol to 1 step -1 if isnumeric(cells(10,i)) then if cells(10,i) < 1 then columns(i).Delete end if end if Next -- Regards, Tom Ogilvy "JEFF" wrote in message ... Hi, I'd like to have my VBA delete those columns where the cell content of row 10 of that same column <1.... Help?! TIA |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Copy column header to next column, delete & delete every nth colum | New Users to Excel | |||
delete cells column. Delete empty cells | Excel Worksheet Functions | |||
Delete Every Column After | Excel Programming | |||
Delete All Rows That Column A value is not in Column A of Sheet2 | Excel Programming | |||
Delete a Row if a Certain Value is in Column C | Excel Programming |