Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
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
Posted to microsoft.public.excel.programming
|
|||
|
|||
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
Posted to microsoft.public.excel.programming
|
|||
|
|||
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
Posted to microsoft.public.excel.programming
|
|||
|
|||
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 |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Scrolling Looping Problem | Excel Discussion (Misc queries) | |||
Macro looping problem. | Excel Discussion (Misc queries) | |||
Looping thru the active selection | Excel Programming | |||
complex looping problem | Excel Programming | |||
Looping Problem | Excel Programming |