+ Reply to Thread
Results 1 to 8 of 8

How to Make Current Open Worksheet as Active

Hybrid View

  1. #1
    Registered User
    Join Date
    08-02-2013
    Location
    Virginia
    MS-Off Ver
    Excel 2007
    Posts
    41

    Re: How to Make Current Open Worksheet as Active

    Apologies for not being so clear, If I am correct the above line is copying the data within the given range from active sheet to Wb1 sheet.
    When I ran the macro, It is copying the sheet1 data range on Sheet2. but what I am looking for is to pull the data from different excel file (here the Source sheet name varies everytime) on Sheet2 of the open file.

    Many thanks,
    Omer

  2. #2
    Forum Guru HaHoBe's Avatar
    Join Date
    02-19-2005
    Location
    Hamburg, Germany
    MS-Off Ver
    work: 2016 on Win10 (notebook), private: 365 on Win11 (desktop), 2019 on Win11 (notebook)
    Posts
    8,198

    Re: How to Make Current Open Worksheet as Active

    Hi, momer,

    you should make clear if Sheet2 is the name displayed on the worksheet tab or the codename for the sheet In your code you have both used Worksheets(2) which would mean the second worksheet in the collection of worksheets as well as Worksheets("Sheet2"). So you could replace
    ThisWorkbook.Sheets(strSheetName)
    by
    ThisWorkbook.Sheets("Sheet2")
    Ciao,
    Holger
    Use Code-Tags for showing your code: [code] Your Code here [/code]
    Please mark your question Solved if there has been offered a solution that works fine for you

+ 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] VBA to Open File (filename contains current date) & copy Sheet to active workbook
    By jlstidham in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 08-12-2013, 10:50 PM
  2. [SOLVED] Make Open Workbook Active Irrespective Of Name
    By OzTrekker in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 09-18-2012, 10:07 PM
  3. Current cell position for a non Active worksheet
    By Wizz in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 12-15-2009, 08:40 PM
  4. Replies: 1
    Last Post: 04-07-2006, 07:54 AM
  5. [SOLVED] How to indicate that the current visible worksheet is the active o
    By George Furnell in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 02-17-2006, 01:30 PM

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