PDA

View Full Version : small help required.



damainman
03-10-2008, 07:38 AM
Hi, how do i get to copy g1 and insert it into b23 if b23 is emtpy? It is to move onto b24 if b23 is not empty and so on.


pseudo example:

copy g1

if b23 = empty then paste
else if b23 <> empty then paste into b24
else if b24 <> empty then paste into b25

and so on until value is pasted.

damainman
03-10-2008, 07:39 AM
i am doing it in excel vba. it will be triggered by a click of a button. thanks.

Bob Phillips
03-10-2008, 07:54 AM
Range("G1").Copy Cells(Rows.Count,"B").End(xlup).Offset(1,0)

damainman
03-10-2008, 08:50 AM
Range("G1").Copy Cells(Rows.Count,"B").End(xlup).Offset(1,0)



Thanks!!!! Thats perfect!!

PaulH
03-11-2008, 04:27 AM
Range("B23).select
nextcell:
If ActiveCell.value = empty then
ActiveCell.value=Range("G1").value
else
ActiveCell.offset(1,0).select
goto nextcell
End if