Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]() A macro to increment a cell's value in Excel 2007 is as easy as: ---------------------------- Sub Test() x = ActiveCell.FormulaR1C1 x = x + 1 ActiveCell.FormulaR1C1 = x End Sub ---------------------------- I have two questions here... The first question is, what is the easiest way to make this work on every cell of a particular column for a selected set of cells? For example, if I select B3:D10, and I want to increment every cell in Column C that is selected? Does this require a complex looping setup, or is there an easy way to set this up? And the second question relates to the fact that the above code only works if the cells contain simple data, such as integers, or a date. How can this be made to work on complex data? For example, if a cell contains data such as "1200x456", and we want to increment whatever comes after the "x"? (So "1200x456" would become "1200x457") Is this too much of a pain to make it worthwhile to code? |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
complex color fill conditions- if statements or complex formula? | Excel Discussion (Misc queries) | |||
data range is too complex. | Charts and Charting in Excel | |||
Incrementing Data based on user input | Excel Discussion (Misc queries) | |||
complex data validation | Excel Discussion (Misc queries) | |||
Complex Data Validations | Excel Programming |