+ Reply to Thread
Results 1 to 9 of 9

dynamic cell reference from other sheets

  1. #1
    Registered User
    Join Date
    03-27-2017
    Location
    Germany
    MS-Off Ver
    office 365 pro plus
    Posts
    38

    dynamic cell reference from other sheets

    Hi everyone. New day new challange.

    I am looking for a way using Excel VBA wherein I Need to copy cell values from column M from (Sheet3,Sheet4,Sheet5,Sheet6,Sheet7) to use them in a formula in Sheet 1. Now this is simple but the trick part is, the column M in all those Sheets is dynamic and number of rows Keep changing everytime a new Report is generated by the user. The formula column in sheets 1 that Needs to be generated using column M values from other Sheets is also dynamic and the number of rows in this column dynamically changes corresponding to the number of rows in column M .

    Thanks

  2. #2
    Forum Expert sintek's Avatar
    Join Date
    12-04-2015
    Location
    Cape Town
    MS-Off Ver
    2013 | 2016 | 2019
    Posts
    13,300

    Re: dynamic cell reference from other sheets

    Hi saaadi1616
    Please upload a sample workbook depicting a before & after scenario so that we can see what we are dealing with.
    Good Luck
    I don't presume to know what I am doing, however, just like you, I too started somewhere...
    One-day, One-problem at a time!!!
    If you feel I have helped, please click on the star to left of post [Add Reputation]
    Also....add a comment if you like!!!!
    And remember...Mark Thread as Solved.
    Excel Forum Rocks!!!

  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: dynamic cell reference from other sheets

    Not sure of what you're after, does this help?

    Please Login or Register  to view this content.

  4. #4
    Registered User
    Join Date
    03-27-2017
    Location
    Germany
    MS-Off Ver
    office 365 pro plus
    Posts
    38

    Re: dynamic cell reference from other sheets

    Looks good. I tried it but some Problems are there. One of the main issues is that whenever we talk about a dynamic row with changing number of rows, we use xlup function. What if there is another set of calculations beneath that table and the last row of the column i am interested in is not the last row of the sheet but the last low i am interested in is where the Input range Ends.

    for example my in put is 10 and 14 (on sheet 1). So i have the column (on other Sheets) with values 10 11 12 13 14. But few rows later there starts another set of calculations. How do I reference this dynamic column (10 to 14) in my formulas?

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

    Re: dynamic cell reference from other sheets

    Still a bit confused, perhaps:

    Please Login or Register  to view this content.
    Last edited by JOHN H. DAVIS; 05-11-2017 at 09:30 AM.

  6. #6
    Registered User
    Join Date
    03-27-2017
    Location
    Germany
    MS-Off Ver
    office 365 pro plus
    Posts
    38

    Re: dynamic cell reference from other sheets

    Hy there. I guess I might be able to solve it with few changes but thanks for the main concept. I was having difficulty giving the Syntax for counting the number of rows.

    I have another smal question, all the values generated by the macro are upto 7 decimals places . I want the values to be calculated only upto 2 decimal places since thats the accuray i am looking for and the macro is already running too slow.

    I am trying with the following and its working but i have to add this code before everyformula which is annoying.

    Selection.NumberFormat = "0.00"

    Is there a way to give a General code at the start of the macro so that all the values it calculate are upto two decimal places.

    Thanks

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

    Re: dynamic cell reference from other sheets

    See my edit too Post #7. Hope that works.

  8. #8
    Registered User
    Join Date
    03-27-2017
    Location
    Germany
    MS-Off Ver
    office 365 pro plus
    Posts
    38

    Re: dynamic cell reference from other sheets

    It did Thanks alot

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

    Re: dynamic cell reference from other sheets

    You're welcome. Glad to help out and thanks for the feedback and the reps. Please mark this thread as SOLVED.

+ 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. Replies: 1
    Last Post: 01-31-2017, 06:32 PM
  2. [SOLVED] Replace a cell reference in a formula with dynamic reference
    By jkj115 in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 08-25-2016, 11:04 AM
  3. [SOLVED] dynamic cell reference
    By bigfishprf in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 07-11-2015, 01:36 PM
  4. Dynamic Cell Reference?
    By kestefon in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 04-17-2014, 11:52 AM
  5. Cell reference dynamic
    By etsoft in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 08-30-2013, 06:43 PM
  6. dynamic cell reference in VBA?
    By blackdawg1969 in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 08-13-2010, 08:36 AM
  7. Dynamic cell reference?
    By EdJ in forum Excel General
    Replies: 2
    Last Post: 08-26-2005, 12:05 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