Hello All,
I would like to make a program that would do the following:
Search for the word Hz in a cell (the cell will typically have the formatting as follows 63 Hz 125 Hz 250 Hz) And set the cell right below that as the upper sum limit. Then take the row just above the activecell row and make that the lower sum limit so that it would look like this sum(UpperSumLimit:LowerSumLimit). This is my coding so far:
Any Advise or help is really appreciated. Thanks!
I would like to make a program that would do the following:
Search for the word Hz in a cell (the cell will typically have the formatting as follows 63 Hz 125 Hz 250 Hz) And set the cell right below that as the upper sum limit. Then take the row just above the activecell row and make that the lower sum limit so that it would look like this sum(UpperSumLimit:LowerSumLimit). This is my coding so far:
PHP:
Sub Delete_Section_click()
Dim ws As Worksheet
Set ws = Worksheets("Input_Data")
iRow = ActiveCell.Row
Rows(iRow).Insert Shift:=xlShiftDown
i = 1
Do While ActiveCell.Value <> "Hz"
ws.Cells(iRow, 2).Value = "Sound Pressure Level"
ws.Cells(iRow, 3).NumberFormat = 0
ws.Cells(iRow, 3).Formula = "=SUM(C" & iRow - i & ":C" & iRow - 1 & ")"
ws.Cells(iRow, 4).NumberFormat = 0
ws.Cells(iRow, 4).Formula = "=SUM(D" & iRow - i & ":D" & iRow - 1 & ")"
ws.Cells(iRow, 5).NumberFormat = 0
ws.Cells(iRow, 5).Formula = "=SUM(E" & iRow - i & ":E" & iRow - 1 & ")"
ws.Cells(iRow, 6).NumberFormat = 0
ws.Cells(iRow, 6).Formula = "=SUM(F" & iRow - i & ":F" & iRow - 1 & ")"
ws.Cells(iRow, 7).NumberFormat = 0
ws.Cells(iRow, 7).Formula = "=SUM(G" & iRow - i & ":G" & iRow - 1 & ")"
ws.Cells(iRow, 8).NumberFormat = 0
ws.Cells(iRow, 8).Formula = "=SUM(H" & iRow - i & ":H" & iRow - 1 & ")"
ws.Cells(iRow, 9).NumberFormat = 0
ws.Cells(iRow, 9).Formula = "=SUM(I" & iRow - i & ":I" & iRow - 1 & ")"
ws.Cells(iRow, 10).NumberFormat = 0
ws.Cells(iRow, 10).Formula = "=SUM(J" & iRow - i & ":J" & iRow - 1 & ")"
i = i + 1
Loop
End Sub
Any Advise or help is really appreciated. Thanks!