Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.worksheet.functions
|
|||
|
|||
![]()
I have a column of numbers (based on an underlying formula), starting
positive at the top. Somewhere in the column, a number becomes negative. How, using VB code, do I search for that cell, where the number =<0. Once the cell is located, I want to then alter the formula of the cell to its left. I would appreciate any help I get. Thanks -- Burt |
#2
![]()
Posted to microsoft.public.excel.worksheet.functions
|
|||
|
|||
![]()
Hi,
You didn't say what you wanted the formula altered to so this simply enter 123 in the appropriate cell Sub ordinate() Set myrange = Range("B1:B" & Cells(Rows.Count, "B").End(xlUp).Row) For Each c In myrange If c.Value < "" And c.Value <= 0 Then c.Offset(0, -1).Value = 123 ' Do what you want Exit Sub End If Next Mike "BurtArkin" wrote: I have a column of numbers (based on an underlying formula), starting positive at the top. Somewhere in the column, a number becomes negative. How, using VB code, do I search for that cell, where the number =<0. Once the cell is located, I want to then alter the formula of the cell to its left. I would appreciate any help I get. Thanks -- Burt |
#3
![]()
Posted to microsoft.public.excel.worksheet.functions
|
|||
|
|||
![]()
Thank you so much for your quick response. I will play with it, and, if
there are any problems (I'm not too swift!), I'll get back to you. -- Burt "Mike H" wrote: Hi, You didn't say what you wanted the formula altered to so this simply enter 123 in the appropriate cell Sub ordinate() Set myrange = Range("B1:B" & Cells(Rows.Count, "B").End(xlUp).Row) For Each c In myrange If c.Value < "" And c.Value <= 0 Then c.Offset(0, -1).Value = 123 ' Do what you want Exit Sub End If Next Mike "BurtArkin" wrote: I have a column of numbers (based on an underlying formula), starting positive at the top. Somewhere in the column, a number becomes negative. How, using VB code, do I search for that cell, where the number =<0. Once the cell is located, I want to then alter the formula of the cell to its left. I would appreciate any help I get. Thanks -- Burt |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Converting Negative Number to Postive number | Excel Worksheet Functions | |||
Converting a negative number to a positive number | Excel Discussion (Misc queries) | |||
negative number to positive number | Excel Discussion (Misc queries) | |||
Locate first number that exceeds reference value | Excel Worksheet Functions | |||
2003= negative number&2004= negative number How Do I Calculate gro | Excel Worksheet Functions |