+ Reply to Thread
Results 1 to 5 of 5

Changing Cell References Through VBA

  1. #1
    Registered User
    Join Date
    02-03-2013
    Location
    Canada
    MS-Off Ver
    Office 365 MSO (16.0.13127.21734) 64-bit
    Posts
    23

    Changing Cell References Through VBA

    I was given a workbook with data that refers to a master data set. In B2 there is a place for user to enter the number of batches. B3 to B50 contain formulas that multiply B2 by a reference in a master data set. When it was written the formulas were written so they could be copied down. (ie =$B$2*'Sheet1'!A2) then this formula was copied down B50. Now we want to have multiple batches on one sheet and would like to change all the formulas from =$B$2*'Sheet1'!A2 to B2*'Sheet1'!$A$2, =$B$3*'Sheet1'!A3 to B2*'Sheet1'!$A$3, and so on. I could go through the cells and change with F4, but I need to do this in 50 workbooks. Can this be changed with VBA.

    Thanks
    Chris

  2. #2
    Forum Expert Arkadi's Avatar
    Join Date
    02-13-2014
    Location
    Smiths Falls, Ontario, Canada
    MS-Off Ver
    Office 365
    Posts
    5,059

    Re: Changing Cell References Through VBA

    If I read it right all you are trying to change is adding $ to the A2, A3, etc? and removing the $ from the B references?
    Last edited by Arkadi; 06-19-2015 at 12:24 PM.
    Please help by:

    Marking threads as closed once your issue is resolved. How? The Thread Tools at the top
    Any reputation (*) points appreciated. Not just by me, but by all those helping, so if you found someone's input useful, please take a second to click the * at the bottom left to let them know

    There are 10 kinds of people in this world... those who understand binary, and those who don't.

  3. #3
    Registered User
    Join Date
    02-03-2013
    Location
    Canada
    MS-Off Ver
    Office 365 MSO (16.0.13127.21734) 64-bit
    Posts
    23

    Re: Changing Cell References Through VBA

    Yes....Long story short need to change both cell references in formula already in cell. Remove $ in one part and add $ to the other.

    Chris

  4. #4
    Forum Expert Arkadi's Avatar
    Join Date
    02-13-2014
    Location
    Smiths Falls, Ontario, Canada
    MS-Off Ver
    Office 365
    Posts
    5,059

    Re: Changing Cell References Through VBA

    Try this one out:

    Please Login or Register  to view this content.

  5. #5
    Registered User
    Join Date
    02-03-2013
    Location
    Canada
    MS-Off Ver
    Office 365 MSO (16.0.13127.21734) 64-bit
    Posts
    23

    Re: Changing Cell References Through VBA

    I would like to say a big thank-you for this. This is exactly what I was looking for. I did, however, have to make 1 modification to make this work. I needed to change
    Please Login or Register  to view this content.
    to
    Please Login or Register  to view this content.
    but this works perfectly.

    Thanks
    Chris

+ 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. Absolute cell references...changing?
    By Dharrison8 in forum Excel General
    Replies: 7
    Last Post: 03-10-2010, 04:14 PM
  2. changing cell references
    By Hein in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 02-03-2009, 03:59 AM
  3. Changing cell references in formulae?
    By ChrisMattock in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 11-17-2008, 12:26 PM
  4. [SOLVED] changing cell references
    By Louise in forum Excel General
    Replies: 1
    Last Post: 10-26-2005, 11:05 AM
  5. [SOLVED] Changing cell references
    By Tracey in forum Excel General
    Replies: 4
    Last Post: 01-04-2005, 05:06 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