+ Reply to Thread
Results 1 to 5 of 5

Selection Change macro to OFFSET

  1. #1
    Forum Contributor
    Join Date
    10-08-2019
    Location
    Singapore
    MS-Off Ver
    2016
    Posts
    326

    Selection Change macro to OFFSET

    Hello there,


    1. I'm trying to write a Selection Change macro to OFFSET the activecell to different cells (columns-Q,S,T) on each row based on the Text(s) contained in the user input cell in column-O. But my code doesn't seem to work. I attached a image below to illustrate my situation, with remarks that specify the criteria needed for how the specified keywords must be found in column-O, including the large/small caps or not they appear, in order for the OFFSET to move. Data in my workbook is from row 5 through to 5000.


    SelChngOFFSET.PNG


    This the last method i used in the most recent attempt at making the code to achieve above, all have failed. I also experimented with InStr & that failed miserably.

    Please Login or Register  to view this content.

    2. The second problem I have is with column-A.
    I use the ISNUMBER function for column-A to return a short ID based on the text string in column-O, all is well till when the keywords in O is more than one keyword to locate. When the Description string in column-O is only 1 keyword to find, say the keyword to lookout for is only "RECYCLE", the ISNUMBER returns "REC" without any error. But i dont know how to use ISNUMBER to also lookout for & cover all the other possibilities shown in above image, ie. when ID should lookout for in the input cell strings that might contain 2 or more keywords simultaneously, if it meets that possibility it can't correctly return the correct ID.

    Here is my effort ISNUMBER example of the failed function for more than 1 keyword to return an ID, example when I need the cell in A5 to return "PWG" if O5 contains ALL 3 keywords "Return","to","via", but it anyhow returns "PWG" even if the user has only typed "Return" withoput typing "to" and "via"

    Please Login or Register  to view this content.


    Hope someone can help me with above 2 issues,

    Stewart.
    Last edited by MannStewart; 06-07-2020 at 09:15 AM.

  2. #2
    Valued Forum Contributor
    Join Date
    04-01-2015
    Location
    The Netherlands
    MS-Off Ver
    2003/2007/2010/2016/office 365
    Posts
    880

    Re: Selection Change macro to OFFSET

    Nice picture. It is difficult to enter code in it.

    Hm, I can't get the code placed in the normal way, so even a picture.

    Knipsel.PNG
    Last edited by Vraag en antwoord; 06-07-2020 at 09:39 AM.

  3. #3
    Forum Contributor
    Join Date
    10-08-2019
    Location
    Singapore
    MS-Off Ver
    2016
    Posts
    326

    Re: Selection Change macro to OFFSET

    Hi Vraag

    Great thanks for the code, which i just tested and seems working, I plan to test it more & hope it works totally for all the keywords.

    Can you guide me on my issue no.2 also ? Because the column A cannot cover the remaining of all possibilities of keywords with 2-words, 3-words combinations, so the outcome in A is not the full possibilities of IDs outcomes at the moment ..


    Stewart
    Last edited by MannStewart; 06-07-2020 at 10:50 AM.

  4. #4
    Valued Forum Contributor
    Join Date
    04-01-2015
    Location
    The Netherlands
    MS-Off Ver
    2003/2007/2010/2016/office 365
    Posts
    880

    Re: Selection Change macro to OFFSET

    See the yellow banner.

  5. #5
    Forum Contributor
    Join Date
    10-08-2019
    Location
    Singapore
    MS-Off Ver
    2016
    Posts
    326

    Re: ISNUMBER(SEARCH.. issue

    sorry, i didn't follow, which yellow banner ? Did you mean i should post a sample workbook ? Kindly have a look my issue for ISNUMBER(SEARCH) function in A5:A20, with the dilemma under remark in the attached sample worksheet.
    Attached Files Attached Files
    Last edited by MannStewart; 06-07-2020 at 11:36 AM. Reason: Attach sample

+ 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] Macro not firing upon selection change
    By cp41 in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 10-23-2013, 03:25 PM
  2. [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
  3. Selection change macro
    By alanb1976 in forum Excel General
    Replies: 7
    Last Post: 08-18-2011, 08:48 AM
  4. Problem with Selection find, offset, copy & paste Macro
    By MDResearcher in forum Excel Programming / VBA / Macros
    Replies: 18
    Last Post: 06-21-2011, 05:51 PM
  5. Macro for Selection Change
    By raghav.k in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 04-28-2011, 04:52 AM
  6. Macro to change dates in a selection
    By Slashy in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 05-15-2008, 07:48 PM
  7. run macro on selection change
    By Tony in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 04-04-2006, 12:15 AM
  8. 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