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
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
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" <[email protected]> wrote in message
news:[email protected]...
> 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
>
>
>
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks