+ Reply to Thread
Results 1 to 8 of 8

Modifying vba code .Formula to cell range

  1. #1
    Forum Contributor
    Join Date
    03-29-2012
    Location
    Canada
    MS-Off Ver
    2007
    Posts
    818

    Modifying vba code .Formula to cell range

    Good day,
    I am trying to modify my code to fit my need but I don't quite remember how I got there. I need to change this code to have a cell range on another sheet that I have.

    Here is the original code:

    Please Login or Register  to view this content.
    I need to change the following to instead of having /HS to have / & Sheets("Controls").Range("D3")

    I need to have this inserted and I tried different tactics but I am getting errors.

    Please Login or Register  to view this content.
    To

    Please Login or Register  to view this content.
    Please help
    Last edited by Excelnoub; 03-02-2014 at 01:51 PM.

  2. #2
    Forum Contributor
    Join Date
    03-29-2012
    Location
    Canada
    MS-Off Ver
    2007
    Posts
    818

    Re: Modifying vba code .Formula to cell range

    Here is the full code in worksheet:

    Please Login or Register  to view this content.

    You need to write information in A5 to A30 (Doesn't matter what) and insert a number in B5 to B30 (Any number but don't go to high) and the result will be in C.
    Last edited by Excelnoub; 03-02-2014 at 02:17 PM.

  3. #3
    Forum Guru Norie's Avatar
    Join Date
    02-02-2005
    Location
    Stirling, Scotland
    MS-Off Ver
    Microsoft Office 365
    Posts
    19,646
    Is it the value from B3 on Controls you want, or a reference to that cell?
    If posting code please use code tags, see here.

  4. #4
    Forum Contributor
    Join Date
    03-29-2012
    Location
    Canada
    MS-Off Ver
    2007
    Posts
    818

    Re: Modifying vba code .Formula to cell range

    I need the Value I presume...

    The Final value in my C will be the following if I add Test in Column A and 001 in Column B: Test/001/HS

    But HS is my section I need to change HS to lets say HP if I transfer my Workbook to another division So I am using a "Controls" sheet to manage this.

  5. #5
    Forum Contributor
    Join Date
    03-29-2012
    Location
    Canada
    MS-Off Ver
    2007
    Posts
    818

    Re: Modifying vba code .Formula to cell range

    Yeah I guess that it would be a reference instead of a Value... The Value will already be inserted in D3 therefore I need to have the code run then add what's in A then / then the number then / then Cell D3 from my "controls" sheet.

    How would I go about to do this?

  6. #6
    Forum Guru Norie's Avatar
    Join Date
    02-02-2005
    Location
    Stirling, Scotland
    MS-Off Ver
    Microsoft Office 365
    Posts
    19,646

    Re: Modifying vba code .Formula to cell range

    I think it would be this to include the value,
    Please Login or Register  to view this content.
    and this to include the cell reference.
    Please Login or Register  to view this content.
    Mind you I'm a bit confused by your code and the formula.

    In the code you first put values in a range then you overwrite those values with a fomula, and that formula seems to have way too many "s in it.

    So the question is, why are you putting values in the range and ovewriting them?

    Also, what should the formula look like on a sheet?

  7. #7
    Forum Guru Norie's Avatar
    Join Date
    02-02-2005
    Location
    Stirling, Scotland
    MS-Off Ver
    Microsoft Office 365
    Posts
    19,646

    Re: Modifying vba code .Formula to cell range

    Actually, just had a rethink on the formula.

    This would include the sheet reference.
    Please Login or Register  to view this content.

  8. #8
    Forum Contributor
    Join Date
    03-29-2012
    Location
    Canada
    MS-Off Ver
    2007
    Posts
    818

    Re: Modifying vba code .Formula to cell range

    Perfect Thank you so much Norie

+ 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. Modifying code that locks a cell to be a password hidden in a specific cell?
    By jonvanwyk in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 06-20-2012, 02:38 PM
  2. Assist in modifying code to locate an exact phrase in a cell
    By Jsin in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 07-09-2010, 02:52 PM
  3. Help modifying code to check for text in a range prior to email sheet.
    By dcgrove in forum Excel Programming / VBA / Macros
    Replies: 9
    Last Post: 07-09-2009, 06:16 PM
  4. Modifying a sumproduct formula to search for words in a cell
    By Weasel in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 07-07-2009, 02:51 PM
  5. modifying this formula to return an empty cell
    By Outbacker in forum Excel General
    Replies: 3
    Last Post: 08-22-2006, 03:10 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