Re: vba looping for blank cells

Tech-Archive recommends: Fix windows errors by optimizing your registry



hey bondi, thanks.. that works almost perfect, but the value needs to
be moved into the blank space above not below - if you get my drift

i.e

30
a 10
a 20
60
b 10
b 20
b 30

can I use the same code as a basis to do this. I know the offset
affects which column but wouldn't know how to find the next row up
rather than the next row down. thankyou for your help with this, BevJ

Bondi wrote:

Hi,

I not sure what you are looking for but this code will take the number
in column C and place it in the first empty cell in column A.

Private Sub CommandButton1_Click()
Dim i
For i = 1 To 20
If Cells(i, 3) <> vbEmpty Then
Cells(i, 3).Offset(1, -2).Value = Cells(i, 3).Value
End If
Next i
End Sub

Regards,
Bondi

.


Quantcast