+ Reply to Thread
Results 1 to 9 of 9

Macro check as bringing wrong line through

  1. #1
    Registered User
    Join Date
    04-12-2013
    Location
    United Kingdom
    MS-Off Ver
    Excel 2010
    Posts
    87

    Macro check as bringing wrong line through

    Hi,

    1. Could someone please check my macros [on my spreadsheet] and tell me why 'Altrincham' is coming through on each macro that is run?

    Secondly, in module two, is it possible when running the Chart macro to have the range to cover offset 3 rows down from the figure in the table and covering 15 down and to J.

    Assuming I will need

    Please Login or Register  to view this content.
    ^
    Not sure how that coding works but I have seen it done.

    ChartHelp.xlsm
    Last edited by aaaaaaiden; 02-11-2014 at 12:39 PM.

  2. #2
    Forum Expert
    Join Date
    02-11-2014
    Location
    New York
    MS-Off Ver
    Excel 365 (Windows)
    Posts
    5,946

    Re: Macro check as bringing wrong line through

    You need to have a header value in Cell B1 - say, "Town", which will solve the Altrincham problem. Also, you should re-use your code instead of having it written out every time: see below.

    And I've added code to add the chart automatically.


    Please Login or Register  to view this content.
    Last edited by Bernie Deitrick; 02-11-2014 at 01:47 PM. Reason: added explanation and code

  3. #3
    Forum Expert
    Join Date
    03-28-2012
    Location
    TBA
    MS-Off Ver
    Office 365
    Posts
    12,454

    Re: Macro check as bringing wrong line through

    Bernie,
    Please use code tags with your code as per forum's rule.

  4. #4
    Registered User
    Join Date
    04-12-2013
    Location
    United Kingdom
    MS-Off Ver
    Excel 2010
    Posts
    87

    Re: Macro check as bringing wrong line through

    That's great!
    What could I do to have the Macro run when the B1 value changes?

  5. #5
    Forum Expert
    Join Date
    02-11-2014
    Location
    New York
    MS-Off Ver
    Excel 365 (Windows)
    Posts
    5,946

    Re: Macro check as bringing wrong line through

    Sorry - I'm new and haven't totally figured this forum out yet...

  6. #6
    Forum Expert
    Join Date
    02-11-2014
    Location
    New York
    MS-Off Ver
    Excel 365 (Windows)
    Posts
    5,946

    Re: Macro check as bringing wrong line through

    If you are changing the B1 value to the various regions (NE, SW, etc.) use data validation on cell B1 (with the list option, and the various region names) and copy this code, right-click the sheet tab, select "View Code" and paste the code into the window that appears. You can then delete all the Sub NW(), Sub LondonRegion(), etc. since this will handle all that.

    Please Login or Register  to view this content.

  7. #7
    Forum Expert
    Join Date
    03-28-2012
    Location
    TBA
    MS-Off Ver
    Office 365
    Posts
    12,454

    Re: Macro check as bringing wrong line through

    Bernie,
    You can add code tags in the following way.
    Highlight the entire code, on the quick reply menu(Above this space), you see the pound sign, i.e. #, just click it.

    If you have already post the code with out tags, you can edit you post, by clicking edit , then select the code and click the # sign.

  8. #8
    Forum Expert
    Join Date
    02-11-2014
    Location
    New York
    MS-Off Ver
    Excel 365 (Windows)
    Posts
    5,946

    Re: Macro check as bringing wrong line through

    Thanks - I figured that out

  9. #9
    Forum Expert
    Join Date
    02-19-2013
    Location
    India
    MS-Off Ver
    07/16
    Posts
    2,386

    Re: Macro check as bringing wrong line through

    you could use below code as all in one and give a dropdown list of all regions in B1 of comparison sheet

    Please Login or Register  to view this content.
    -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

    WANT TO SAY THANKS, HIT ADD REPUTATION (*) AT THE BOTTOM LEFT CORNER OF THE POST

    More we learn about excel, more it shows us, how less we know about it.

    for chemistry
    https://www.youtube.com/c/chemistrybyshivaansh

  10. #10
    Registered User
    Join Date
    04-12-2013
    Location
    United Kingdom
    MS-Off Ver
    Excel 2010
    Posts
    87

    Re: Macro check as bringing wrong line through

    Perfect got it to work.. thank you all +rep'd

+ 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. [SOLVED] Vlookup bringing wrong data
    By wayneg in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 05-20-2013, 04:44 AM
  2. lookup function bringing in wrong info
    By Bernie Deitrick in forum Excel Formulas & Functions
    Replies: 14
    Last Post: 09-06-2005, 09:05 PM
  3. [SOLVED] lookup function bringing in wrong info
    By Julieeeee in forum Excel Formulas & Functions
    Replies: 0
    Last Post: 09-06-2005, 02:05 AM
  4. lookup function bringing in wrong info
    By Julieeeee in forum Excel Formulas & Functions
    Replies: 0
    Last Post: 09-06-2005, 01:05 AM
  5. If...Then Problem - bringing up wrong info!
    By gunman in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 06-07-2005, 09:05 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