Sleeper: If and Statement based on one cell and
I am trying to find a solution to If cell is >1 and the cell below is blank (""), then insert formula into specific cell location.
Code:
Sub InsertSlopeFormula()
Dim Cell As Range
For Each Cell In Range("C1:C115")
If Cell.Value > 1 And Cell.Value.Offset(1, 0) = "" Then
Cell.Value.Offset(2, 0) = "a"
End If
Next Cell
End Sub
If and Statement based on reference to 1st cell
Quote:
Originally Posted by
p45cal
Code:
Sub InsertSlopeFormula()
Dim Cell As Range
For Each Cell In Range("C1:C115")
If Cell.Value > 1 And Cell.Offset(1).Value = "" Then Cell.Offset(2).Value = "a"
Next Cell
End Sub
p45cal,
Thanks for that. I am certainly closer to success now!!! The code works except when i have multiple blanks as it continues to see data in the loop. Please see below and share any thoughts as I am looking for a solution to only fill in the second blank row it comes to with a formula.
10796414.8 |
10796414.8 |
10796414.8 |
10796414.8 |
10796414.8 |
10796414.8 |
10796414.8 |
10796414.8 |
|
a |
|
a |
|
a |
|
a |
|
a |
|
|
1 Attachment(s)
If and Statement based on reference to 1st cell
AussieBear,
thanks for the reply. i have attached the workbook.
If and Statement based on reference to 1st cell
AussieBear,
thanks for the reply. i have attached the workbook.
1 Attachment(s)
If and Statement based on reference to 1st cell
p45cal,
Point well taken. I have attached an additional workbook ("wytheville finished") showing the desired end product. Aussiebear is correct that these are gps points. The sheet I am working on is a small sample of what are sometimes 100k plus points. As you can see from the finished sheet, the next step is to calculate the slope % from one first point to last point to allow for corrections to Range "D". Range "D" is the actual ground elevation. I can then calculate what the actual elevation should be in Range "E". Lastly, Range "F" lets me see the slope between two sets of points looking East to West. Any further assistance would be greatly appreciated. :bow::bow::bow:
If and Statement based on reference to 1st cell