Quote Originally Posted by Rajesh Kr Joshi View Post
Hi,

I would lke to drag a formula in row D27 towards right. It should stop once there is a blank cell.

Thanks
Rajesh
Hello Rajesh:
Step one:.....add a new module in the VBA environment
Step two.....paste in the subroutine below which will be effectively a macro called "fillacross"

Code:
Sub fillacross()
Dim myrow, mycol As Integer
mycol = 4 'the D Column
myrow = 27 'the 27th row

    Do Until Cells(myrow, mycol + 1).Value = "" 'looping aross the columns until blank cell
        'The next code is to copy across the column on the same row
            Cells(myrow, mycol + 1).Value = Cells(myrow, mycol).Value
            mycol = mycol + 1
    Loop
    
End Sub
Step three put some different data in cells D27, E27, F27, G27 .....up to wherever you like but not too far across ...see below
Step four run the macro called "Fillacross"

Note:
This works...I have tested it.
BUT
You need an error trapping routine if it all goes wrong and reaches the column limitation of 256 Columns.
I have a routine for this if you would find it useful
This macro takes the value of the Cell D27 and overwrites all data in the 27th row from the D column onwards with this until a blank cell is reached