database linking

pradyuthal

Board Regular
Joined
Jul 13, 2005
Messages
212
Code:
Sub foo()
    '   Copy Data to a recordset
    Dim LastRow As Range
    Dim i As Integer
        Set LastRow = Sheets("Sheet2").Cells(Rows.Count, "A").End(xlUp)
    
            For i = 1 To 5
                LastRow.Offset(1, i - 1) = ActiveSheet.Cells(1, i)
                ActiveSheet.Cells(1, i) = ""
            Next i
End Sub

I have the above code with the help of which I can only copy the entries from  the first row , but I want to copy entries made in cell a5 , b11 and d20 .

Please modify the above code to some extent so that I may be able to do my job .

Thanks in advance .
 

Some videos you may like

Excel Facts

What does custom number format of ;;; mean?
Three semi-colons will hide the value in the cell. Although most people use white font instead.

Watch MrExcel Video

Forum statistics

Threads
1,113,955
Messages
5,545,162
Members
410,667
Latest member
Gaexel
Top