+ Reply to Thread
Results 1 to 6 of 6

Need VBA code to get two set of range from closed wb and 4 column to next sheet

  1. #1
    Forum Contributor
    Join Date
    07-21-2011
    Location
    Bangalore,India
    MS-Off Ver
    Excel 2007,2010,2016
    Posts
    695

    Need VBA code to get two set of range from closed wb and 4 column to next sheet

    Hi experts

    i have old month file in local folder i want copy into into my active sheet to refer but its huge file take alot of time to open

    i want copy from 2 set of range from closed wb(Master_File),sheet(Shride_Bridge_Data), A2:H2 and J2:Q2 add new sheet paste into active sheet in same range end with copy and paste 4 column from active sheet.


    i store file in path C:\Users\Windows 10\Desktop\FY-2022

    find the attachment
    Attached Files Attached Files
    Last edited by breadwinner; 11-15-2022 at 09:05 AM. Reason: file missing

  2. #2
    Forum Expert
    Join Date
    02-11-2014
    Location
    New York
    MS-Off Ver
    Excel 365 (Windows)
    Posts
    5,942

    Re: Need VBA code to get two set of range from closed wb and 4 column to next sheet

    Try extracting the values using formula links:

    Please Login or Register  to view this content.
    Bernie Deitrick
    Excel MVP 2000-2010

  3. #3
    Forum Contributor
    Join Date
    07-21-2011
    Location
    Bangalore,India
    MS-Off Ver
    Excel 2007,2010,2016
    Posts
    695

    Re: Need VBA code to get two set of range from closed wb and 4 column to next sheet

    HI sir

    thanks for code i have nt got result as i expected please have a look

    This is what i got result , not create new sheet and paste data from Master file.
    Attached Images Attached Images
    Last edited by breadwinner; 11-15-2022 at 05:22 PM. Reason: missed points

  4. #4
    Forum Expert
    Join Date
    02-11-2014
    Location
    New York
    MS-Off Ver
    Excel 365 (Windows)
    Posts
    5,942

    Re: Need VBA code to get two set of range from closed wb and 4 column to next sheet

    Sorry - you stated you wanted ranges A2:H2 and J2:Q2 which is what my code did.

    In reality to you want the entire sheet from the master workbook.

    The best way to do that is to use a Power Query - open a new workbook, then choose Data / New Query / From File / From Workbook and the choose your file and go through the steps to select the sheet in the workbook that you want. PQ will pull the updated values from that workbook any time you update your query.

  5. #5
    Forum Guru
    Join Date
    08-15-2004
    Location
    Tokyo, Japan
    MS-Off Ver
    2013 O.365
    Posts
    22,518

    Re: Need VBA code to get two set of range from closed wb and 4 column to next sheet

    Use whichever faster.
    1)
    Please Login or Register  to view this content.
    2)
    Please Login or Register  to view this content.

  6. #6
    Forum Contributor
    Join Date
    07-21-2011
    Location
    Bangalore,India
    MS-Off Ver
    Excel 2007,2010,2016
    Posts
    695

    Re: Need VBA code to get two set of range from closed wb and 4 column to next sheet

    Thanks alot sir Smart Code ever save my work.

+ 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. [SOLVED] Need Help with VBA to run vba code on closed wb from active sheet
    By breadwinner in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 11-07-2022, 08:53 AM
  2. [SOLVED] Required vba code exlcel sheet automatic closed when specify date passed
    By sbvaram in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 12-05-2020, 08:24 AM
  3. [SOLVED] VB Code to import data range from closed workbook
    By rizmomin in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 08-26-2019, 04:44 AM
  4. [SOLVED] vba code from closed workbook to update active sheet not working as requested
    By JEAN1972 in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 10-22-2017, 09:35 AM
  5. [SOLVED] Need help on code to map the range from closed workbook with attch
    By breadwinner in forum Excel Programming / VBA / Macros
    Replies: 10
    Last Post: 12-20-2013, 10:01 PM
  6. Search for Value in Closed Workbook and copy Column to Active Sheet Column BE
    By Winon in forum Excel Programming / VBA / Macros
    Replies: 9
    Last Post: 12-19-2011, 12:57 PM
  7. Error with VBA code Copying cells to a closed workbook, template sheet, documents and
    By Libster78 in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 01-30-2010, 12:31 PM

Tags for this Thread

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