Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Finding cells using a style
Is there any way to find all the cells in a worksheet/workbook that use a
particular style? I can only think of looping over all cells but that will be far too slow for the size of workbooks I have. The problem I have is that I want to be able to change the number format on all cells that have the Total style. The Total style though doesn't include a number format currently, and instead will be either a number or percentage depending on how the user has configured it. I need to update the decimal places used in the cells, so was going to write a tool to look at all cells with the Total style. |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
Finding cells using a style
In newer versions of excel (xl2002+, I think), you can show the Find dialog and
include formatting for the search criteria. In fact, if you're doing it manually, you can look within the workbook. But if you're doing it by code, you'll have to loop through the sheets. You can record a macro when specify the formatting parms to get the syntax correct. If you're using xl2k or earlier, you'll be stuck looping through the worksheets and through the usedranges. Simon Reid wrote: Is there any way to find all the cells in a worksheet/workbook that use a particular style? I can only think of looping over all cells but that will be far too slow for the size of workbooks I have. The problem I have is that I want to be able to change the number format on all cells that have the Total style. The Total style though doesn't include a number format currently, and instead will be either a number or percentage depending on how the user has configured it. I need to update the decimal places used in the cells, so was going to write a tool to look at all cells with the Total style. -- Dave Peterson |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
Finding cells using a style
Great, I am using Excel 2007, and am actually coding it in C# using VSTO, I
assume you can use the Range.Find method? "Dave Peterson" wrote: In newer versions of excel (xl2002+, I think), you can show the Find dialog and include formatting for the search criteria. In fact, if you're doing it manually, you can look within the workbook. But if you're doing it by code, you'll have to loop through the sheets. You can record a macro when specify the formatting parms to get the syntax correct. If you're using xl2k or earlier, you'll be stuck looping through the worksheets and through the usedranges. Simon Reid wrote: Is there any way to find all the cells in a worksheet/workbook that use a particular style? I can only think of looping over all cells but that will be far too slow for the size of workbooks I have. The problem I have is that I want to be able to change the number format on all cells that have the Total style. The Total style though doesn't include a number format currently, and instead will be either a number or percentage depending on how the user has configured it. I need to update the decimal places used in the cells, so was going to write a tool to look at all cells with the Total style. -- Dave Peterson . |
#4
Posted to microsoft.public.excel.programming
|
|||
|
|||
Finding cells using a style
I don't speak C# or VSTO. But I could do it in VBA.
Simon Reid wrote: Great, I am using Excel 2007, and am actually coding it in C# using VSTO, I assume you can use the Range.Find method? "Dave Peterson" wrote: In newer versions of excel (xl2002+, I think), you can show the Find dialog and include formatting for the search criteria. In fact, if you're doing it manually, you can look within the workbook. But if you're doing it by code, you'll have to loop through the sheets. You can record a macro when specify the formatting parms to get the syntax correct. If you're using xl2k or earlier, you'll be stuck looping through the worksheets and through the usedranges. Simon Reid wrote: Is there any way to find all the cells in a worksheet/workbook that use a particular style? I can only think of looping over all cells but that will be far too slow for the size of workbooks I have. The problem I have is that I want to be able to change the number format on all cells that have the Total style. The Total style though doesn't include a number format currently, and instead will be either a number or percentage depending on how the user has configured it. I need to update the decimal places used in the cells, so was going to write a tool to look at all cells with the Total style. -- Dave Peterson . -- Dave Peterson |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
How to stop style for col A changing to style of co D date vs $ | Setting up and Configuration of Excel | |||
How do I change sheet notation from R1C1 style to A1 style in XL 2 | Setting up and Configuration of Excel | |||
How do I convert US style dates to European style? | Excel Discussion (Misc queries) | |||
can a1 reference style and r1c1 style be used in same formula? | Excel Worksheet Functions | |||
Select Cells by Style | Excel Programming |