Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 921
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 921
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 921
Default 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
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Copy column header to next column, delete & delete every nth colum genehunter New Users to Excel 1 June 2nd 09 03:57 PM
delete cells column. Delete empty cells myshak Excel Worksheet Functions 0 March 9th 09 10:59 PM
Delete Every Column After Michael Smith Excel Programming 2 March 14th 05 08:36 PM
Delete All Rows That Column A value is not in Column A of Sheet2 [email protected] Excel Programming 2 September 3rd 04 09:13 PM
Delete a Row if a Certain Value is in Column C John Excel Programming 10 June 13th 04 01:03 PM


All times are GMT +1. The time now is 03:07 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"