+ Reply to Thread
Results 1 to 4 of 4

code involving two workbooks, runs correctly from one workbook but not the other

  1. #1
    Registered User
    Join Date
    07-18-2019
    Location
    berlin
    MS-Off Ver
    10
    Posts
    2

    code involving two workbooks, runs correctly from one workbook but not the other

    Hello All,

    My first time posting here and very much a beginner in the VBA world.

    I have some code that gets some cell references from one workbook in order to reference a cell in another workbook.

    For some reason running it from the first workbook it wont let me select the cell in the second one, but if i reverse things and run the code from the second workbook, it works fine.

    I dont know what I have wrong! any advice would be appreciated. I need it to run from the first one for various other reasons further down the line.


    Please Login or Register  to view this content.

  2. #2
    Forum Contributor
    Join Date
    11-10-2017
    Location
    INDIA
    MS-Off Ver
    365
    Posts
    184

    Re: code involving two workbooks, runs correctly from one workbook but not the other

    Hi,

    If you want to reverse the process just replace the file name & sheet name of first with second one.
    200117_Pricing Sheet.xlsm with 200117_Xylo Sales Cash Flow.xlsm and vice versa

    Attach the sample file to assist better, refer the yellow banner above
    HOW TO ATTACH YOUR SAMPLE WORKBOOK:
    *If you wish you click on *,a way to say ThankYou

  3. #3
    Registered User
    Join Date
    07-18-2019
    Location
    berlin
    MS-Off Ver
    10
    Posts
    2

    Re: code involving two workbooks, runs correctly from one workbook but not the other

    Hi Sunny,

    Thanks for the hint, Ill give it a try and attach the workbook if I cant get anywhere with it !

    Best

  4. #4
    Forum Moderator - RIP Richard Buttrey's Avatar
    Join Date
    01-14-2008
    Location
    Stockton Heath, Cheshire, UK
    MS-Off Ver
    Office 365, Excel for Windows 2010 & Excel for Mac
    Posts
    29,464

    Re: code involving two workbooks, runs correctly from one workbook but not the other

    Hi and welcome to the forum

    Do you literally mean that the macro refuses to select a cell and an error message pops up ("it won't let me select the cell"), or it selects a cell but not the one you expect?

    As has been suggested plese upload the two workbooks.
    Richard Buttrey

    RIP - d. 06/10/2022

    If any of the responses have helped then please consider rating them by clicking the small star icon below the post.

+ 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. Excel Destroys my Workbook Every Time it Contains (Not Runs) This Code
    By Michael.T in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 08-21-2019, 09:43 PM
  2. [SOLVED] VBA code runs slow when other workbooks are open
    By JimDandy in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 07-27-2016, 12:47 AM
  3. Replies: 4
    Last Post: 06-25-2014, 03:22 PM
  4. Code runs on entire workbook...need it to only run on one worksheet
    By jrobertson2403 in forum Excel Programming / VBA / Macros
    Replies: 8
    Last Post: 11-28-2013, 04:50 PM
  5. [SOLVED] Shortening Code so it runs if another workbook is acitve
    By ScabbyDog in forum Excel Programming / VBA / Macros
    Replies: 11
    Last Post: 10-17-2012, 06:47 AM
  6. Combobox code runs while closing and opening of workbook
    By shreyasdate in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 09-07-2012, 07:47 AM
  7. Code runs in wrong workbook?
    By Ian in forum Excel Programming / VBA / Macros
    Replies: 13
    Last Post: 11-27-2005, 11:00 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