Copying column data from one sheet to another

petenaylor

New Member
Joined
Jan 29, 2010
Messages
5
Hi all

I am new to Macros and I need a little help with a project I have just been given. I have two sheets in an Excel workbook. One has the information in column D starting in cell D2 in my 'source' sheet.

I want to be able to copy all the entries in that column to another sheet called 'empty' and start the import in cell D10.

The thing is there will be a different amount of entries in the column in the 'source' sheet so I will need a loop.

Can anyone help?

Many thanks
Pete
 

Domski

Well-known Member
Joined
Jan 18, 2005
Messages
7,292
Try:

Code:
Sub test()
With Sheets("Source")
.Range("D2:" & .Cells(Rows.Count, 4).End(xlUp).Row).Copy Sheets("Empty").Range("D10")
End With
End Sub
Dom
 

VoG

Legend
Joined
Jun 19, 2002
Messages
63,651
Try

Code:
Sub Cpy()
Dim LR As Long
With Sheets("Source")
    LR = .Range("D" & Rows.Count).End(xlUp).Row
    .Range("D2:D" & LR).Copy Destination:=Sheets("Empty").Range("D10")
End With
End Sub
 

petenaylor

New Member
Joined
Jan 29, 2010
Messages
5
Brilliant! Thanks ever so much for the quick response, they work just as I want.

Cheers
Pete.
 

Forum statistics

Threads
1,081,748
Messages
5,361,041
Members
400,610
Latest member
ebey

Some videos you may like

This Week's Hot Topics

  • populate from drop list with multiple tables
    Hi All, i have a drop list that displays data, what i want is when i select one of those from the list to populate text from different tables on...
  • Find list of words from sheet2 in sheet1 before a comma and extract text vba
    Hi Friends, Trying to find the solution on my task. But did not find suitable one to the need. Here is my query and sample file with details...
  • Dynamic Formula entry - VBA code sought
    Hello, really hope one of you experts can help with this - i've spent hours on this and getting no-where. .I have a set of data (more rows than...
  • Listbox Header
    Have a named range called "AccidentsHeader" Within my code I have: [CODE]Private Sub CommandButton1_Click() ListBox1.RowSource =...
  • Complex Heat Map using conditional formatting
    Good day excel world. I have a concern. Below link have a list of countries that carries each country unique data. [URL...
  • Conditional formatting
    Hi good morning, hope you can help me please, I have cells P4:P54 and if this cell is equal to 1 then i want row O to say "Fully Utilised" and to...
Top