+ Reply to Thread
Results 1 to 2 of 2

Copying Selective columns

  1. #1
    Oldjay
    Guest

    Copying Selective columns

    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




  2. #2
    Tom Ogilvy
    Guest

    Re: 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" <[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
    >
    >
    >




+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1