+ Reply to Thread
Results 1 to 18 of 18

search data based on column by inputbox user and mark the cells in the same row

  1. #1
    Forum Contributor
    Join Date
    07-14-2021
    Location
    LY
    MS-Off Ver
    2019
    Posts
    271

    search data based on column by inputbox user and mark the cells in the same row

    hi
    I search for way to search the data based on names in column B .so when I put the name MUSSA into nputbox user then should add oval shape into multiple cells in the same row for each name as 1n sheet case1 , if put the names into inputbox user lke this( MUSSA,MUSS,MUSSIA) then should add oval shape into multiple cells in the same row for theses names . also when run the code should delete oval shape is existed in any cell when inputbox user is empty .
    this is what I have so far
    HTML Code: 
    Attached Files Attached Files

  2. #2
    Forum Expert sintek's Avatar
    Join Date
    12-04-2015
    Location
    Cape Town
    MS-Off Ver
    2013 | 2016 | 2019
    Posts
    13,239

    Re: search data based on column by inputbox user and mark the cells in the same row

    Please Login or Register  to view this content.

    OR
    Do you mean this...
    Please Login or Register  to view this content.
    Last edited by sintek; 12-07-2021 at 05:18 AM.
    Good Luck
    I don't presume to know what I am doing, however, just like you, I too started somewhere...
    One-day, One-problem at a time!!!
    If you feel I have helped, please click on the star to left of post [Add Reputation]
    Also....add a comment if you like!!!!
    And remember...Mark Thread as Solved.
    Excel Forum Rocks!!!

  3. #3
    Forum Contributor
    Join Date
    07-14-2021
    Location
    LY
    MS-Off Ver
    2019
    Posts
    271

    Re: search data based on column by inputbox user and mark the cells in the same row

    thanks . the second code what I means , but I would treat the error . if I press cancel or close the inputbox should exit without do anythng .
    also when run the code should delete oval shape is existed in any cell when inputbox user is empty .
    every time I run the macro should delete the shapes before I search for any name into inputbox .

  4. #4
    Forum Expert sintek's Avatar
    Join Date
    12-04-2015
    Location
    Cape Town
    MS-Off Ver
    2013 | 2016 | 2019
    Posts
    13,239

    Re: search data based on column by inputbox user and mark the cells in the same row

    if I press cancel or close the inputbox should exit without do anythng.
    Please Login or Register  to view this content.
    every time I run the macro should delete the shapes before I search for any name into inputbox .
    Your code does that...
    Please Login or Register  to view this content.

  5. #5
    Forum Contributor
    Join Date
    07-14-2021
    Location
    LY
    MS-Off Ver
    2019
    Posts
    271

    Re: search data based on column by inputbox user and mark the cells in the same row

    If Valu = "" Then Exit Sub
    thanks again
    ActiveSheet.DrawingObjects.Delete
    I woundered from this . it doesn't seem to work . it just moves the oval shape from the old name has already been searched to new name which search for it
    when I run the inputbox should n't show any oval shape for any cell until it write name into inputbox. every time run the inputbox is empty should dissapear the oval shape.

  6. #6
    Forum Expert sintek's Avatar
    Join Date
    12-04-2015
    Location
    Cape Town
    MS-Off Ver
    2013 | 2016 | 2019
    Posts
    13,239

    Re: search data based on column by inputbox user and mark the cells in the same row

    it doesn't seem to work
    Step through code...You will see all shapes are deleted...
    Then one by one are added again to new search criteria...

  7. #7
    Forum Contributor
    Join Date
    07-14-2021
    Location
    LY
    MS-Off Ver
    2019
    Posts
    271

    Re: search data based on column by inputbox user and mark the cells in the same row

    when run the code by F8 the code works , but when link with button and run it doesn't delete it , also it delete the button despite of use:
    Right click on the button
    Click on Format Control
    Under the properties tab, select Don't move or size with cells
    with all of these steps still delete the button

  8. #8
    Forum Expert
    Join Date
    05-05-2015
    Location
    UK
    MS-Off Ver
    Microsoft Excel for Microsoft 365 MSO (Version 2402 Build 16.0.17328.20068) 64-bit
    Posts
    28,209

    Re: search data based on column by inputbox user and mark the cells in the same row

    It deletes the button because it is a shape and the macro deletes ALL shapes!!!

    So why not simply highlight cells with a background colour ??
    If that takes care of your original question, please select Thread Tools from the menu link above and mark this thread as SOLVED.

  9. #9
    Forum Expert sintek's Avatar
    Join Date
    12-04-2015
    Location
    Cape Town
    MS-Off Ver
    2013 | 2016 | 2019
    Posts
    13,239

    Re: search data based on column by inputbox user and mark the cells in the same row

    but when link with button and run it doesn't delete it
    It does delete it...The code just runs so fast you do not see it...The result you see is the result of the search...
    So do a loop through shapes and if ignore button...
    Change red snippet to your Macro Button Name
    Please Login or Register  to view this content.
    Last edited by sintek; 12-07-2021 at 08:08 AM.

  10. #10
    Forum Contributor
    Join Date
    07-14-2021
    Location
    LY
    MS-Off Ver
    2019
    Posts
    271

    Re: search data based on column by inputbox user and mark the cells in the same row

    It does delete it.
    sorry I was saying it delete it. actually shouldn't delete it to run the code by button .
    but I no know why the code works when run f8 step by step it delete the shapes when run the macro . and if I run directly from inside vba editor or by button doesn't delete the shapes when run the macro . also if I add
    HTML Code: 
    in new macro it will delete it .
    I'm so confused

  11. #11
    Forum Expert sintek's Avatar
    Join Date
    12-04-2015
    Location
    Cape Town
    MS-Off Ver
    2013 | 2016 | 2019
    Posts
    13,239

    Re: search data based on column by inputbox user and mark the cells in the same row

    I'm so confused
    What do you want to do...???

    Does Post 9 not make sense?

  12. #12
    Forum Contributor
    Join Date
    07-14-2021
    Location
    LY
    MS-Off Ver
    2019
    Posts
    271

    Re: search data based on column by inputbox user and mark the cells in the same row

    Does Post 9 not make sense?
    it's ok . but I'm talking about this
    every time run the inputbox is empty should dissapear the oval shape.
    let's take this example when search for name it will add oval shape . this step is ok as pic1 , but when run again should be like pic2 not pic3 .
    I hope explained my view
    Attached Images Attached Images

  13. #13
    Forum Expert
    Join Date
    05-05-2015
    Location
    UK
    MS-Off Ver
    Microsoft Excel for Microsoft 365 MSO (Version 2402 Build 16.0.17328.20068) 64-bit
    Posts
    28,209

    Re: search data based on column by inputbox user and mark the cells in the same row

    See attached with SINTEK's code from Post #9
    Attached Files Attached Files
    Last edited by JohnTopley; 12-07-2021 at 09:09 AM.

  14. #14
    Forum Expert
    Join Date
    05-05-2015
    Location
    UK
    MS-Off Ver
    Microsoft Excel for Microsoft 365 MSO (Version 2402 Build 16.0.17328.20068) 64-bit
    Posts
    28,209

    Re: search data based on column by inputbox user and mark the cells in the same row

    Please Login or Register  to view this content.
    Added highlighted code

  15. #15
    Forum Expert sintek's Avatar
    Join Date
    12-04-2015
    Location
    Cape Town
    MS-Off Ver
    2013 | 2016 | 2019
    Posts
    13,239

    Re: search data based on column by inputbox user and mark the cells in the same row

    Add red snippet for Pic2 requirement

    Please Login or Register  to view this content.

  16. #16
    Forum Expert sintek's Avatar
    Join Date
    12-04-2015
    Location
    Cape Town
    MS-Off Ver
    2013 | 2016 | 2019
    Posts
    13,239

    Re: search data based on column by inputbox user and mark the cells in the same row

    Thanks for rep +
    If that takes care of your original question, please select Thread Tools from the menu link above and mark this thread as SOLVED.

  17. #17
    Forum Contributor
    Join Date
    07-14-2021
    Location
    LY
    MS-Off Ver
    2019
    Posts
    271

    Re: search data based on column by inputbox user and mark the cells in the same row

    @JohnTopley based on post# 14 it's perfect ! many thanks

  18. #18
    Forum Contributor
    Join Date
    07-14-2021
    Location
    LY
    MS-Off Ver
    2019
    Posts
    271

    Re: search data based on column by inputbox user and mark the cells in the same row

    @sintek based on post#15 it doesn't treat problem deleting the button . so I see the correct is
    HTML Code: 
    many thanks for your code and time

+ 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] Search Column for specified data and mark in separate column
    By Casey825 in forum Excel General
    Replies: 8
    Last Post: 01-05-2018, 01:43 PM
  2. inputbox for search column and text
    By ladydee94 in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 03-15-2017, 12:58 AM
  3. [SOLVED] MACRO: If user clicks cancel in inputbox,then do nothing. Problem with inputbox appearance
    By Tona in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 11-05-2015, 04:33 AM
  4. Replies: 1
    Last Post: 01-30-2015, 01:02 PM
  5. [SOLVED] Formula to search a table based on user choices to produces a value in Column E
    By Attrition in forum Excel Formulas & Functions
    Replies: 7
    Last Post: 03-07-2014, 09:31 PM
  6. [SOLVED] VBA code to search in a column and mark in another.
    By Anka in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 12-27-2012, 06:58 PM
  7. Replies: 4
    Last Post: 02-20-2012, 06:50 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