View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Tom Ogilvy Tom Ogilvy is offline
external usenet poster
 
Posts: 27,285
Default Copying Selective columns

Sub aa()
Dim rng As Range
Set rng = Range(Cells(1, 1), Cells(Rows.Count, 1).End(xlUp))
Set rng = Union(rng, rng.Offset(0, 3))
Worksheets.Add
Range("A1").Select
rng.Copy
ActiveSheet.Paste

End Sub

or if you want them in columns A and D on the new sheet

Dim rng as Range
set rng = Range(cells(1,2),cells(rows.count,1).End(xlup))
Worksheets.Add
rng.copy Destination:=Range("A1")
rng.offset(0,3).Copy Destination:=Range("D1")

--
Regards,
Tom Ogilvy





"Oldjay" wrote in message
...
I want a Macro that will select the A and the D columns (this column has
blank cells) of a database(database records is variable) and only copy
these two columns to a new sheet