Error Checking in Excel
Thanks Thanks:  0
Likes Likes:  0
Results 1 to 5 of 5

Thread: row headings

  1. #1
    Board Regular
    Join Date
    Mar 2002
    Posts
    1,451
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Default

    I have a sheet1 where I run a macro that makes a filter and than copy the result of this filter to sheet2.
    I like to add also the row headings from sheet1 to sheet2.
    How can I do that within the same macro?
    Many thanks.

  2. #2
    Board Regular
    Join Date
    Mar 2002
    Location
    Cincinnati, Ohio, USA
    Posts
    6,824
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Default

    Hi
    Assuming that your headers are in row 1.

    Sheets("Sheet1").Rows("1:1").Copy Destination:= _
    Sheets("Sheet2").Rows("1:1")

    Tom

  3. #3
    Board Regular
    Join Date
    Mar 2002
    Posts
    1,451
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Default

    On 2002-04-23 01:21, TsTom wrote:
    Hi
    Assuming that your headers are in row 1.

    Sheets("Sheet1").Rows("1:1").Copy Destination:= _
    Sheets("Sheet2").Rows("1:1")

    Tom
    Thanks Tom,but what if sheet2 is in anoter workbook?Is this possible?
    Thanks in advance

  4. #4
    MrExcel MVP
    Colo's Avatar
    Join Date
    Mar 2002
    Location
    Kobe, Japan
    Posts
    1,456
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    2 Thread(s)

    Default

    Hi verluc. Pls try this.

    Sheets("Sheet1").Rows(1).Copy _
    Workbooks("NameOfAnotherBook.xls").Sheets("Sheet2").Rows(1)


    Regards,
    Colo

  5. #5
    Board Regular
    Join Date
    Mar 2002
    Posts
    1,451
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Default

    On 2002-04-23 01:11, verluc wrote:
    I have a sheet1 where I run a macro that makes a filter and than copy the result of this filter to sheet2.
    I like to add also the row headings from sheet1 to sheet2.
    How can I do that within the same macro?
    Many thanks.
    In my question I like to add the row headings but is this also possible to add several cells in place of the hole row?
    Many thanks

Some videos you may like

User Tag List

Like this thread? Share it with others

Like this thread? Share it with others

Posting Permissions

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