+ Reply to Thread
Results 1 to 24 of 24

change macro for selection column I

  1. #1
    Forum Contributor
    Join Date
    10-31-2018
    Location
    venezia
    MS-Off Ver
    2007
    Posts
    487

    change macro for selection column I

    Hi everyone,
    the attached macro works for all selected cells.


    Please Login or Register  to view this content.
    You can change it to work only for the sheet "PRC2" column I3:I1000
    Thank you
    john

  2. #2
    Forum Expert
    Join Date
    05-29-2020
    Location
    NH USA
    MS-Off Ver
    365
    Posts
    2,103

    Re: change macro for selection column I

    Try this code,although untested since the last line is not an end sub(not complete sub)


    Please Login or Register  to view this content.

  3. #3
    Forum Contributor
    Join Date
    10-31-2018
    Location
    venezia
    MS-Off Ver
    2007
    Posts
    487

    Re: change macro for selection column I

    Hi maniacb thanks you.
    Error here:
    rng = Range("I3:I1000")
    Attached Files Attached Files

  4. #4
    Forum Expert
    Join Date
    05-29-2020
    Location
    NH USA
    MS-Off Ver
    365
    Posts
    2,103

    Re: change macro for selection column I

    This is hopefully working to your expectations.

    Please Login or Register  to view this content.
    Attached Files Attached Files

  5. #5
    Forum Contributor
    Join Date
    10-31-2018
    Location
    venezia
    MS-Off Ver
    2007
    Posts
    487

    Re: change macro for selection column I

    No maniacb in not correct.
    If I select example in sheet "PRC2" value AAA10 > button "TROVA/FIND"
    in sheet "PRC1" the value AAA10 must be selected.

  6. #6
    Valued Forum Contributor
    Join Date
    08-03-2012
    Location
    Newcastle
    MS-Off Ver
    Excel 2007, 2010, 2013, 2016, Office 365
    Posts
    467

    Re: change macro for selection column I

    HI

    try this..
    Please Login or Register  to view this content.
    zeddy

  7. #7
    Forum Contributor
    Join Date
    10-31-2018
    Location
    venezia
    MS-Off Ver
    2007
    Posts
    487

    Re: change macro for selection column I

    Hi zzeddy thanks you.
    Your macro is almost exact but it should only work for column I sheet PRC2.
    If a different column / cell is selected, it must give an error

  8. #8
    Forum Guru
    Join Date
    09-10-2017
    Location
    Chippenham, England
    MS-Off Ver
    365
    Posts
    15,077

    Re: change macro for selection column I

    Just change the ranges on this line from col A to col I
    Please Login or Register  to view this content.

  9. #9
    Forum Contributor
    Join Date
    10-31-2018
    Location
    venezia
    MS-Off Ver
    2007
    Posts
    487

    Re: change macro for selection column I

    Fluff13 error:

    error run time 91
    variable or block object not set

  10. #10
    Valued Forum Contributor
    Join Date
    08-03-2012
    Location
    Newcastle
    MS-Off Ver
    Excel 2007, 2010, 2013, 2016, Office 365
    Posts
    467

    Re: change macro for selection column I

    Hi

    A slight adjustment then..
    Please Login or Register  to view this content.
    zeddy
    Excel Adjustment Bureau

  11. #11
    Forum Guru
    Join Date
    09-10-2017
    Location
    Chippenham, England
    MS-Off Ver
    365
    Posts
    15,077

    Re: change macro for selection column I

    error run time 91
    variable or block object not set
    In that case please post your modified code.

  12. #12
    Forum Contributor
    Join Date
    10-31-2018
    Location
    venezia
    MS-Off Ver
    2007
    Posts
    487

    Re: change macro for selection column I

    Hi zeddy work well.
    is it possible to modify with new msgbox if in PRC1 there is no value as selected in PRC2?
    john

  13. #13
    Forum Contributor
    Join Date
    10-31-2018
    Location
    venezia
    MS-Off Ver
    2007
    Posts
    487

    Re: change macro for selection column I

    For fluffy13
    i changed the line as you say
    error 91

    Please Login or Register  to view this content.
    Please Login or Register  to view this content.
    Attached Files Attached Files

  14. #14
    Forum Guru
    Join Date
    09-10-2017
    Location
    Chippenham, England
    MS-Off Ver
    365
    Posts
    15,077

    Re: change macro for selection column I

    I misunderstood what you were trying to do, use the commented out line & it works fine.

  15. #15
    Valued Forum Contributor
    Join Date
    08-03-2012
    Location
    Newcastle
    MS-Off Ver
    Excel 2007, 2010, 2013, 2016, Office 365
    Posts
    467

    Re: change macro for selection column I

    Hi John

    Re: is it possible to modify with new msgbox if in PRC1 there is no value as selected in PRC2?
    Here's some adjusted code..
    Please Login or Register  to view this content.
    zeddy
    Excel Triple-A Solutions

  16. #16
    Forum Contributor
    Join Date
    10-31-2018
    Location
    venezia
    MS-Off Ver
    2007
    Posts
    487

    Re: change macro for selection column I

    Hi zwddy work well.

    'Dim zMatch As Worksheet correct is Worksheet?

    Please Login or Register  to view this content.

  17. #17
    Forum Contributor
    Join Date
    10-31-2018
    Location
    venezia
    MS-Off Ver
    2007
    Posts
    487

    Re: change macro for selection column I

    Dim zMatch As variant

  18. #18
    Forum Guru
    Join Date
    03-02-2006
    Location
    Los Angeles, Ca
    MS-Off Ver
    WinXP/MSO2007;Win10/MSO2016
    Posts
    12,598

    Re: change macro for selection column I

    Please Login or Register  to view this content.
    Ben Van Johnson

  19. #19
    Forum Contributor
    Join Date
    10-31-2018
    Location
    venezia
    MS-Off Ver
    2007
    Posts
    487

    Re: change macro for selection column I

    Hi protonleath
    I tried your macro but it doesn't work correctly, selecting the cell sheet PRC2 doesn't show the same in the sheet PRC1
    john
    Attached Files Attached Files

  20. #20
    Forum Guru
    Join Date
    03-02-2006
    Location
    Los Angeles, Ca
    MS-Off Ver
    WinXP/MSO2007;Win10/MSO2016
    Posts
    12,598

    Re: change macro for selection column I

    It works the way you described above. I added some code to report findings and errors, though.
    Attached Files Attached Files

  21. #21
    Forum Contributor
    Join Date
    10-31-2018
    Location
    venezia
    MS-Off Ver
    2007
    Posts
    487

    Re: change macro for selection column I

    Hi protonleath your macro work well.
    I add this in your macro:

    Please Login or Register  to view this content.
    to display the selected cell and color the row.
    but it does not work

    to remove the colored line in the module of the sheet PCI1 i put

    Please Login or Register  to view this content.
    Attached Files Attached Files
    Last edited by john_cash; 08-09-2020 at 07:12 AM.

  22. #22
    Forum Contributor
    Join Date
    10-31-2018
    Location
    venezia
    MS-Off Ver
    2007
    Posts
    487

    Re: change macro for selection column I

    Correct I think it is correct.
    Added:
    Please Login or Register  to view this content.
    and i can't add in this msg

    Please Login or Register  to view this content.
    in the sheet PRC1


    john
    Attached Files Attached Files
    Last edited by john_cash; 08-09-2020 at 11:48 AM.

  23. #23
    Forum Guru
    Join Date
    03-02-2006
    Location
    Los Angeles, Ca
    MS-Off Ver
    WinXP/MSO2007;Win10/MSO2016
    Posts
    12,598

    Re: change macro for selection column I

    Please Login or Register  to view this content.
    Please Login or Register  to view this content.
    Last edited by protonLeah; 08-09-2020 at 04:14 PM.

  24. #24
    Forum Contributor
    Join Date
    10-31-2018
    Location
    venezia
    MS-Off Ver
    2007
    Posts
    487

    Re: change macro for selection column I

    Hi protonleath, thanks you.
    john
    Last edited by john_cash; 08-10-2020 at 01:01 PM.

+ 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. Change the selection of column data
    By lemonchibs in forum Hello..Introduce yourself
    Replies: 2
    Last Post: 01-16-2016, 10:00 AM
  2. [SOLVED] Selection Change event - certain column, certain value
    By D_N_L in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 07-16-2014, 06:44 AM
  3. [SOLVED] Macro to change shape/macro button colours based on selection
    By deanstein in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 03-15-2013, 08:26 AM
  4. Replies: 0
    Last Post: 02-02-2012, 03:16 PM
  5. How to Keep Selection in Column But Change to 2 rows less
    By Launchnet in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 12-13-2009, 11:51 PM
  6. Change from Column Selection to Cell Selection
    By Lil Pun in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 06-16-2006, 06:15 PM
  7. macro to change cells on change of selection
    By scottwilsonx in forum Excel Programming / VBA / Macros
    Replies: 10
    Last Post: 01-13-2005, 04:14 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