Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Hello
I'd trying to write some code to do the following. Any help much appreciated. Find the last row in the worksheet with cells that are not empty, then define a selection between that row and row 4. Within that selection, iteratively find cells that contain a value (number only). For each cell that does, take that number and write into a simple formula in that cell: '=[found value]/$H$3'. Thanks Ben |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
for a specific column I assume. For illustration, for the pseudo code below,
I will use column B. Sub ABC() Dim rng as Range, rng1 as Range, cell as Range set rng = Range(cells(4,2),cells(rows.count,2)) on error resume next set rng1 = rng.specialcells(xlconstants,xlnumbers) On error goto 0 if not rng1 is nothing then for each cell in rng1 cell.formula = "=" & cell.Value & "/$H$3" next End if End sub -- Regards, Tom Ogilvy "Ben Burns" wrote: Hello I'd trying to write some code to do the following. Any help much appreciated. Find the last row in the worksheet with cells that are not empty, then define a selection between that row and row 4. Within that selection, iteratively find cells that contain a value (number only). For each cell that does, take that number and write into a simple formula in that cell: '=[found value]/$H$3'. Thanks Ben |
#3
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
On 18 Jun, 13:38, Tom Ogilvy
wrote: for a specific column I assume. For illustration, for the pseudo code below, I will use column B. Sub ABC() Dim rng as Range, rng1 as Range, cell as Range set rng = Range(cells(4,2),cells(rows.count,2)) on error resume next set rng1 = rng.specialcells(xlconstants,xlnumbers) On error goto 0 if not rng1 is nothing then for each cell in rng1 cell.formula = "=" & cell.Value & "/$H$3" next End if End sub -- Regards, Tom Ogilvy "Ben Burns" wrote: Hello I'd trying to write some code to do the following. Any help much appreciated. Find the last row in the worksheet with cells that are not empty, then define a selection between that row and row 4. Within that selection, iteratively find cells that contain a value (number only). For each cell that does, take that number and write into a simple formula in that cell: '=[found value]/$H$3'. Thanks Ben Brilliant. Thank you Tom |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Searching a date range to output values according to a constant. | Excel Discussion (Misc queries) | |||
Searching a date range to output values according to a constant. | Excel Discussion (Misc queries) | |||
Formula for Searching & matching two values in excel | Excel Discussion (Misc queries) | |||
Searching a range and copying values into a new range.... **Please help** :( | Excel Programming | |||
Searching for Data Values in a Column - Formula Only | Excel Programming |