+ Reply to Thread
Results 1 to 3 of 3

Need dynamic range select and copy Paste

Hybrid View

  1. #1
    Registered User
    Join Date
    10-09-2013
    Location
    india
    MS-Off Ver
    Excel 2003
    Posts
    1

    Need dynamic range select and copy Paste

    I am new to macro and need help.....
    the requirement is...i have 2 excel sheets...having dynamic number of rows and columns...
    Now i want to copy and paste the second sheet's column and cells below it into the first sheet after the last column of first sheet...
    For Example.....
    IF my sheet1 has columns starting D to M...and my sheet2 has columns starting D to E.....
    so after macro my first sheet should have columns from D to O....
    Please note that The number of columns in sheet 1 & 2 are dynamic so i can't fix the paste column as N.....

    Please help

  2. #2
    Forum Guru sktneer's Avatar
    Join Date
    04-30-2011
    Location
    Kanpur, India
    MS-Off Ver
    Office 365
    Posts
    9,655

    Re: Need dynamic range select and copy Paste

    Do you want it to work like this?
    Attached Files Attached Files
    Regards
    sktneer


    Treat people the way you want to be treated. Talk to people the way you want to be talked to.
    Respect is earned NOT given.

  3. #3
    Forum Expert
    Join Date
    06-12-2012
    Location
    Ridgefield Park, New Jersey
    MS-Off Ver
    Excel 2003,2007,2010
    Posts
    10,241

    Re: Need dynamic range select and copy Paste

    Maybe:

    Sub rags_rags()
    Sheets("Sheet2").Range(Cells(2, 4), Cells(ActiveSheet.UsedRange.Rows.count, ActiveSheet.UsedRange.Columns.count + 1)).Copy Sheets("Sheet1").Cells(2, Sheets("Sheet1").UsedRange.Columns.count + 1)
    End Sub

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. How to copy a dynamic range with VBA and paste in another workbook?
    By cody4334 in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 05-20-2013, 12:01 AM
  2. [SOLVED] Copy and Paste Dynamic Range
    By VKS in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 04-27-2013, 11:14 AM
  3. how do you select (or copy) a dynamic range
    By twiggywales in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 12-03-2012, 07:18 PM
  4. Copy dynamic range from previous sheet and paste after last used row in a range
    By Mistweaver in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 08-04-2010, 06:24 PM
  5. Copy and paste dynamic range
    By wpryan in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 04-16-2010, 09:42 AM

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