Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
CLR CLR is offline
external usenet poster
 
Posts: 1,998
Default Step down a list

Hi All..........
I have a list that starts in B5 and extends downward for I don't know how
many rows. I would like to select B5 and run MyCoolMacro, then step down to
B6 and run MyCoolMacro again, etc etc as far down as there are cells in
column B with values in them..........help please

Vaya con Dios,
Chuck, CABGx3

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default Step down a list

Sub RunMyCool()
Dim rng as Range, cell as Range
With Worksheets("Sheet1")
.Activate
set rng = .Range(.Range("B5"),.Range("B5").End(xldown))
End With
for each cell in rng
cell.Select
MyCoolMacro
Next
End Sub

Assumes your macro works on the activecell.

--
Regards,
Tom Ogilvy


"CLR" wrote in message
...
Hi All..........
I have a list that starts in B5 and extends downward for I don't know how
many rows. I would like to select B5 and run MyCoolMacro, then step down

to
B6 and run MyCoolMacro again, etc etc as far down as there are cells in
column B with values in them..........help please

Vaya con Dios,
Chuck, CABGx3



  #3   Report Post  
Posted to microsoft.public.excel.programming
CLR CLR is offline
external usenet poster
 
Posts: 1,998
Default Step down a list

Thanks very much Tom. As usual, your solution does the trick very nicely.

Vaya con Dios,
Chuck, CABGx3


"Tom Ogilvy" wrote:

Sub RunMyCool()
Dim rng as Range, cell as Range
With Worksheets("Sheet1")
.Activate
set rng = .Range(.Range("B5"),.Range("B5").End(xldown))
End With
for each cell in rng
cell.Select
MyCoolMacro
Next
End Sub

Assumes your macro works on the activecell.

--
Regards,
Tom Ogilvy


"CLR" wrote in message
...
Hi All..........
I have a list that starts in B5 and extends downward for I don't know how
many rows. I would like to select B5 and run MyCoolMacro, then step down

to
B6 and run MyCoolMacro again, etc etc as far down as there are cells in
column B with values in them..........help please

Vaya con Dios,
Chuck, CABGx3




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
Creating a Drop Down List with Step by Step Instructions for 2007 remarkable Excel Worksheet Functions 2 March 22nd 09 04:36 AM
Need step by step to add invoice numbering to excel template rmt New Users to Excel 4 July 6th 08 11:45 PM
Excel 2000 Step By Step. What URL to use in Lesson 8? dougcsdp New Users to Excel 4 March 4th 08 05:07 AM
What is the step-by-step procedure for making a data list? Bobgolfs56 Excel Discussion (Misc queries) 1 April 23rd 05 02:19 PM
I need step by step instructions to create a macro for 10 imbedde. diana Excel Worksheet Functions 3 January 31st 05 01:56 AM


All times are GMT +1. The time now is 09:35 AM.

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

About Us

"It's about Microsoft Excel"