Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 30
Default Syntax - Loop through rows in a selection

I want to modify the following code that loop through each item in a selection
-----
Dim x as Range

For Each x In Selection
retrievename = Sheets("EmailList").Range("B" & x.Row).value
Next x
------

I want it to only loop through each row in the selection (not each item)

What is the proper syntax

I thought Maybe this would work ... but I was wrong. It loops the proper
number of times however SelectRow always refers to the first row that is
selected
--------
For counter = 1 To Selection.Rows.Count
SelectRow = Selection.row
retrievename = Sheets("EmailList").Range("B" & SelectRow).value
Next counter
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
Syntax for stopping a Do Loop? bondjel Excel Discussion (Misc queries) 5 March 22nd 10 01:35 PM
Syntax - Loop through rows in a selection Dave Peterson Excel Programming 0 October 1st 07 08:07 PM
Do...Loop syntax help? DB74 Excel Programming 5 September 4th 07 07:04 PM
What is the selection syntax hon123456 Excel Programming 6 September 12th 06 02:20 AM
loop syntax Knox Excel Programming 2 May 17th 06 06:57 PM


All times are GMT +1. The time now is 02:15 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"