Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3
Default Looping through (active??) cells problem

Hello All,

I have an excel workbook which has some fields set as the £ currency format.
I would like to be able to programatically loop through all active cells in
each worksheet - check to see if the format is pounds and then change them
to say ? or $ if required. I know how to do everything except for looping
through the cells.

Is there any way of getting the Active Cell range for a worksheet?

The only way i can do it at the moment is loop through all cells (which
would take a LONG time) or loop through a set number of cells that i
specify - the only problem with doing this is if a user was to insert more
rows and the rows go outside the set range then these cells are not updated.
I am sure i am missing something so simple...

Any help is greatly appreciated,

Neil.


  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 618
Default Looping through (active??) cells problem

Hi Neil

by ACTIVE CELL RANGE do you mean the currently selected cells?

if so then you can do the following

For Each cell In Selection
'do whatever
Next

Cheers
JulieD

"Neil" wrote in message
...
Hello All,

I have an excel workbook which has some fields set as the £ currency

format.
I would like to be able to programatically loop through all active cells

in
each worksheet - check to see if the format is pounds and then change them
to say ? or $ if required. I know how to do everything except for looping
through the cells.

Is there any way of getting the Active Cell range for a worksheet?

The only way i can do it at the moment is loop through all cells (which
would take a LONG time) or loop through a set number of cells that i
specify - the only problem with doing this is if a user was to insert more
rows and the rows go outside the set range then these cells are not

updated.
I am sure i am missing something so simple...

Any help is greatly appreciated,

Neil.




  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default Looping through (active??) cells problem

for each cell in Activesheet.UsedRange

Next

--
Regards,
Tom Ogilvy

"Neil" wrote in message
...
Hello All,

I have an excel workbook which has some fields set as the £ currency

format.
I would like to be able to programatically loop through all active cells

in
each worksheet - check to see if the format is pounds and then change them
to say ? or $ if required. I know how to do everything except for looping
through the cells.

Is there any way of getting the Active Cell range for a worksheet?

The only way i can do it at the moment is loop through all cells (which
would take a LONG time) or loop through a set number of cells that i
specify - the only problem with doing this is if a user was to insert more
rows and the rows go outside the set range then these cells are not

updated.
I am sure i am missing something so simple...

Any help is greatly appreciated,

Neil.




  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3
Default Looping through (active??) cells problem

Thanks for you replies, it was UsedRange that i needed to use and it works
great (Cheers for that Tom).

Neil.


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
Scrolling Looping Problem Nick Wakeham Excel Discussion (Misc queries) 0 June 12th 07 01:42 PM
Macro looping problem. [email protected] Excel Discussion (Misc queries) 8 October 26th 06 02:44 PM
Looping thru the active selection No Name Excel Programming 2 June 4th 04 08:09 PM
complex looping problem Max Bialystock Excel Programming 16 April 10th 04 01:56 PM
Looping Problem Todd Huttenstine[_3_] Excel Programming 5 January 25th 04 12:51 AM


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