K
ksnapp
ok here is how this sub is supposed to work:
I select a section in column H and then I run the sub.
When it finds a cell that is not blank in that selection of column H
it assigns that value to Dim A. Then it looks over in the A column an
moves up the A column until it finds a cell that is not blank.
When it finds the non blank cell in column A it then puts the value
in that row in column F.
the it moves on down the originaly selected column H
here is what really happens:
I make my selection and run the sub
it takes the value for all non blank cells in column H and copys the
into column M of the same row.
Here is my code, please help
Sub addthingspartb()
Dim A As Single
Dim X As Single
For Each cell In selection
If cell.Value <> "" Then
A = cell.Value
cell.Offset(0, -7).Select
If cell.Value = "" Then
cell.Offset(-1, 0).Select
Else
cell.Offset(0, 5).Value = A
End If
End If
Next cell
End Su
I select a section in column H and then I run the sub.
When it finds a cell that is not blank in that selection of column H
it assigns that value to Dim A. Then it looks over in the A column an
moves up the A column until it finds a cell that is not blank.
When it finds the non blank cell in column A it then puts the value
in that row in column F.
the it moves on down the originaly selected column H
here is what really happens:
I make my selection and run the sub
it takes the value for all non blank cells in column H and copys the
into column M of the same row.
Here is my code, please help
Sub addthingspartb()
Dim A As Single
Dim X As Single
For Each cell In selection
If cell.Value <> "" Then
A = cell.Value
cell.Offset(0, -7).Select
If cell.Value = "" Then
cell.Offset(-1, 0).Select
Else
cell.Offset(0, 5).Value = A
End If
End If
Next cell
End Su