View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Chip Pearson Chip Pearson is offline
external usenet poster
 
Posts: 7,247
Default Cycle through a list



Try something like the following:

Dim R As Range
For Each R In Range("MyRange").Columns(1).Cells
R.EntireRow.Cells(1,"F") = 1234
Next R

Cordially,
Chip Pearson
Microsoft MVP 1998 - 2010
Pearson Software Consulting, LLC
www.cpearson.com
[email on web site]


On Tue, 12 Jan 2010 16:35:01 -0800, Basil
wrote:

Hi,

I have a more comprehensive query below but don't really have the time to
wait for a comprehensive answer.

Could you please help me with going through a list in VBA?

I have a named range and the first column has a list of countries. I want to
go through this list and do an action for each country. Can you please help
with how to do this? I've tried things like application.index(myrange,,1)
with no luck, and don't know the appropriate way to cycle through once I have
that too.

I have a fuller query ('Creating multiple pivot report at run time') with no
replies below. If that is a step too far, help with the abive would be
greatly appreciated.

Many thanks,

Basil