+ Reply to Thread
Results 1 to 12 of 12

Change a whole row based off one column macro!!!

  1. #1
    Registered User
    Join Date
    11-06-2015
    Location
    San Diego
    MS-Off Ver
    2013
    Posts
    82

    Change a whole row based off one column macro!!!

    Hi Guys,

    You guys always give me such great advice so I thought I would ask for some help. So I have a large workbook of multiple constants and formulas and constants I am looking to convert the whole workbook between different currencies like dollars, euros,pounds etc. So How I would like to do this is add another column to each sheet and basically enter a currency symbol like $ or € and if that row in the new column contains that currency character then it will multiply the whole row by a conversion factor. I am pretty comfortable with if statements and DIm ranges and all that but I feel a little confused on this one. How would you guys recommend I go about this? an example of many a few lines of the code would be really helpful. Thank you so much for reading this and i appreciate any help.

    best,
    Your friend!

  2. #2
    Registered User
    Join Date
    11-06-2015
    Location
    San Diego
    MS-Off Ver
    2013
    Posts
    82

    Re: Change a whole row based off one column macro!!!

    Hi guys,
    Basically all I want is a macro that say says in column B for any cell that has an "x" multply the corresponding row by a number say 5. but this has to run based on another cell like if cell F2 says euro then run that code and multiply by say 0.97 or something. Anything helps.
    thank you guys.

  3. #3
    Valued Forum Contributor bulina2k's Avatar
    Join Date
    11-20-2012
    Location
    Urziceni, Ialomita, Romania
    MS-Off Ver
    2019 and 365
    Posts
    861

    Re: Change a whole row based off one column macro!!!

    Hi there!
    Can you upload a sample file? with the initial data and the result data (maybe in another sheet) ?
    .. and don't forget to have fun!
    Bogdan.

    mark SOLVED and Add Reputation if my answer pleases you

  4. #4
    Registered User
    Join Date
    11-06-2015
    Location
    San Diego
    MS-Off Ver
    2013
    Posts
    82

    Re: Change a whole row based off one column macro!!!

    Hi,
    I really can't I am sorry this is very sensitive information for my job. But what I can tell you is I am trying to make an if statement that basically says (if any cell in column B contains "X" then multiply the rest of the row that has the ("x") by 5) That is really all I need. every other cell in column B that doesn't have an X will just be empty. I will hide this column at the end. I am just very confused on how to write the above if statement. Anything helps.
    Thank you all so much.

  5. #5
    Registered User
    Join Date
    11-06-2015
    Location
    San Diego
    MS-Off Ver
    2013
    Posts
    82

    Re: Change a whole row based off one column macro!!!

    an example of the code I have so far but it doesnt work

    Please Login or Register  to view this content.

  6. #6
    Valued Forum Contributor bulina2k's Avatar
    Join Date
    11-20-2012
    Location
    Urziceni, Ialomita, Romania
    MS-Off Ver
    2019 and 365
    Posts
    861

    Re: Change a whole row based off one column macro!!!

    I was asking for a sample file just to see the structure of your data (position and format...)
    In the absence of that I will try this way:
    lets say the symbol goes in I2 (like your code).. so the row 2 (A2:H2) must be multipled by .. 2 (e.g) then you can easily use
    Please Login or Register  to view this content.
    or if the coef is a variable x
    you can use:
    Please Login or Register  to view this content.

  7. #7
    Registered User
    Join Date
    11-06-2015
    Location
    San Diego
    MS-Off Ver
    2013
    Posts
    82

    Re: Change a whole row based off one column macro!!!

    Hi,
    Thank you for replying but this will not work.
    Basically I have a large data set with column A containing names abd every other column containing numerical values where some rows are contants and some rows are formulas from other sheets. What I need is an If statement which says (if any cell in column B has an ("x") then multiply the rest of that row i.e column C to say Z by a numerical value in this case say 5). Cell I2 is just where I will put the numerical value to multiply by when I run the macro. Anything helps.
    Thank you.

  8. #8
    Registered User
    Join Date
    11-06-2015
    Location
    San Diego
    MS-Off Ver
    2013
    Posts
    82

    Re: Change a whole row based off one column macro!!!

    Hi,
    Also in this case I named column B "configpgb"
    thank you

  9. #9
    Valued Forum Contributor bulina2k's Avatar
    Join Date
    11-20-2012
    Location
    Urziceni, Ialomita, Romania
    MS-Off Ver
    2019 and 365
    Posts
    861

    Re: Change a whole row based off one column macro!!!

    blindcoded:

    Please Login or Register  to view this content.

  10. #10
    Registered User
    Join Date
    11-06-2015
    Location
    San Diego
    MS-Off Ver
    2013
    Posts
    82

    Re: Change a whole row based off one column macro!!!

    Hi,
    YES!!!! that works you are amazing thank you so much!! I added the if part and it is awesome thanks you.
    Cheers,
    Your friend

  11. #11
    Valued Forum Contributor bulina2k's Avatar
    Join Date
    11-20-2012
    Location
    Urziceni, Ialomita, Romania
    MS-Off Ver
    2019 and 365
    Posts
    861

    Re: Change a whole row based off one column macro!!!

    Glad to help!
    Please mark the thread as SOLVED and Add Reputation if you wish.
    Have fun!

  12. #12
    Registered User
    Join Date
    11-06-2015
    Location
    San Diego
    MS-Off Ver
    2013
    Posts
    82

    Re: Change a whole row based off one column macro!!!

    Hi,
    Thank you again. I am trying to add more sheets to this macro for the work book is large and I would like it to work across more than one sheet at once. I will add the code I have below maybe you could help me be able to make this work for multiple sheets?
    Please Login or Register  to view this content.

+ 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: 3
    Last Post: 12-16-2015, 05:56 PM
  2. Need Help - Automatic website navigation page change based on column data change
    By cbatten01 in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 01-10-2015, 08:00 PM
  3. [SOLVED] Change all matching Value based on number change in Column Excel 2007
    By Excelnoub in forum Excel Programming / VBA / Macros
    Replies: 20
    Last Post: 02-20-2014, 11:40 AM
  4. paste RNG numbers
    By kaohik78 in forum Excel General
    Replies: 0
    Last Post: 09-26-2012, 10:30 PM
  5. macro needed: change cell colour based on input in another column
    By weesteev in forum Excel Programming / VBA / Macros
    Replies: 11
    Last Post: 05-23-2012, 02:47 PM
  6. Macro to change font color based on contents of another column
    By Pat Parker in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 03-28-2010, 12:33 AM
  7. [SOLVED] Excel Macro to change row and font color based on column value
    By MT in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 09-01-2005, 08:05 AM

Tags for this Thread

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