SOLVED

Can anyone help with this problem and point me in the right direction please.

%3CLINGO-SUB%20id%3D%22lingo-sub-160246%22%20slang%3D%22en-US%22%3ECan%20anyone%20help%20with%20this%20problem%20and%20point%20me%20in%20the%20right%20direction%20please.%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-160246%22%20slang%3D%22en-US%22%3E%3CP%3E%3CSTRONG%3E%3C%2FSTRONG%3E%3C%2FP%3E%0A%3CP%3EHi%20all%2C%3C%2FP%3E%0A%3CP%3EI%20need%20help%20with%20either%20vba%20code%20or%20formula.%3C%2FP%3E%0A%3CP%3EI%20have%20a%20data%20validation%20drop%20down%20list%20which%20contains%20numbers%201-45.%3C%2FP%3E%0A%3CP%3EI%20am%20able%20to%20select%20multiple%20numbers%20from%20the%20drop%20down%20list%20at%20once.%3C%2FP%3E%0A%3CP%3ELook%20at%20the%20middle%20column.%20Below%20RUN%20No%20is%20my%20drop%20list.%20Below%20this%20are%20columns%20with%20various%20numbers%20and%20letters.%20The%20numbers%20I%20am%20interested%20in%20are%20the%20black%20font%20size%2018%20(23%20for%20example).%3C%2FP%3E%0A%3CP%3EWhen%20I%20select%2023%20from%20my%20drop%20list%20I%20want%20excel%20to%20do%20the%20following%20things.%3C%2FP%3E%0A%3CP%3E1.%20create%20a%20border%20containing%20the%20cell%20with%2023%20in%2C%20the%20cell%20to%20the%20left%2C%20and%20the%20block%20of%204%20cells%20below%20ending%20up%20with%20a%20block%20of%20cells%202%20x%203%20inside%20a%20border.%26nbsp%3B%3C%2FP%3E%0A%3CP%3E2.%20highlight%20the%20cells%20within%20the%20border.%3C%2FP%3E%0A%3CP%3E3.%20it%20is%20very%20important%20that%20the%20selected%20cells%20remain%20like%20this%20when%20other%20cells%20are%20being%20selected.%3C%2FP%3E%0A%3CP%3ECan%20anyone%20help%20me%20and%20point%20me%20in%20the%20right%20direction.%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3Emany%20thanks%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3ELee%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%3E%3CSPAN%20class%3D%22lia-message-image-wrapper%22%3E%3CIMG%20title%3D%22Capture.PNG%22%20class%3D%22lia-media-image%22%20alt%3D%22Capture.PNG%22%20src%3D%22https%3A%2F%2Fgxcuf89792.i.lithium.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F27437iDE40493FBB715C7A%2Fimage-size%2Flarge%3Fv%3D1.0%26amp%3Bpx%3D999%22%20border%3D%220%22%20%2F%3E%20%3CI%20class%3D%22lia-fa%20lia-fa-search-plus%20lia-media-lightbox-trigger%22%3E%3C%2FI%3E%20%3C%2FSPAN%3E%3C%2FSPAN%3E%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-LABS%20id%3D%22lingo-labs-160246%22%20slang%3D%22en-US%22%3E%3CLINGO-LABEL%3EMacros%20%26amp%3B%20VBA%3C%2FLINGO-LABEL%3E%3CLINGO-LABEL%3ENeed%20Help%3C%2FLINGO-LABEL%3E%3C%2FLINGO-LABS%3E%3CLINGO-SUB%20id%3D%22lingo-sub-160679%22%20slang%3D%22en-US%22%3ERe%3A%20Can%20anyone%20help%20with%20this%20problem%20and%20point%20me%20in%20the%20right%20direction%20please.%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-160679%22%20slang%3D%22en-US%22%3E%3CP%3EHi%20Willy%20Lau%2C%3C%2FP%3E%0A%3CP%3EThank%20you%20for%20your%20response.%3C%2FP%3E%0A%3CP%3EThe%20cells%20highlighted%20in%20yellow%20have%20not%20been%20selected%2C%20but%20are%20highlighted%20for%20another%20reason.%3C%2FP%3E%0A%3CP%3EIf%20Run%20No%2018%20was%20selected%20it%20would%20have%20to%20be%20shaded%20in%20red%20with%2075%25%20grey.%20It%20would%20also%20be%20the%20same%20as%20I%20mentioned%2C%20a%20block%20of%206%20cells%202%20wide%20by%203%20high.%3C%2FP%3E%0A%3CP%3EPoint%201%20that%20you%20mentioned%2C%20only%20the%20Run%20No's%20selected%20would%20be%20highlighted%20and%20have%20to%20remain%20highlighted%20when%20other%20Run%20No's%20are%20selected.%20This%20is%20because%20other%20Run%20No's%20may%20be%20selected%20at%20a%20later%20stage%20by%20the%20user.%3C%2FP%3E%0A%3CP%3EPoint%202%20that%20you%20mentioned%2C%20the%20Data%20Validation%20list%20has%20the%20ability%20to%20have%20multiple%20selections%20made%20at%20once.%20Therefore%20I%20could%20choose%20Run%20No%2023%20on%20its%20own%20or%2023%20and%2024%20together.%3C%2FP%3E%0A%3CP%3EThe%20Data%20Validation%20selection%20refers%20to%20the%20numbers%20in%20the%20column%20directly%20below.%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EI%20hope%20this%20clarifies%20things%20a%20little%20better%20for%20you.%3C%2FP%3E%0A%3CP%3EAnd%20once%20again%20many%20thanks%20for%20your%20response%20I%20have%20been%20trying%20to%20get%20help%20with%20this%20problem%20for%20months%20now.%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3ERegards%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3ELee%20Ashton%26nbsp%3B%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-160530%22%20slang%3D%22en-US%22%3ERe%3A%20Can%20anyone%20help%20with%20this%20problem%20and%20point%20me%20in%20the%20right%20direction%20please.%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-160530%22%20slang%3D%22en-US%22%3E%3CP%3EI%20would%20like%20to%20have%20a%20try%2C%20but%2C%20your%20sample%20doesn't%20show%20as%20what%20you%20want.%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EFor%20example%2C%20point%201%2C%20after%20selecting%2023%2C%20the%204%20cells%20(2x2)%20below%20it%20are%20not%20highlighted.%26nbsp%3B%20%26nbsp%3BI%20guess%20it%20would%20look%20like%20%2218%22%20in%20your%20screenshot%2C%20but%20only%202x2cells%20(including%20the%20number%20row)%20are%20highlighted%2C%20not%202x3.%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EAlso%2C%20would%20you%20please%20clarify%3C%2FP%3E%0A%3COL%3E%0A%3CLI%3EIf%20those%20%22RUN%20NO%22%20are%20selected%2C%20do%20you%20mean%20all%20the%20cells%20contains%20the%20%22RUN%20NO%22s%20will%20be%20highlighted%3B%20or%20just%20the%20cells%20below%20that%20RUN%20NO%20will%20be%20highlighted%3F%3CBR%20%2F%3EWhat%20I%20am%20asking%20is%2C%20for%20example%2C%20if%20I%20select%20%2218%22%20on%20the%20%22RUN%20NO%22%20above%20%2229%20BACK%22%2C%20should%20we%20highlight%20the%20%2218%22%20which%20is%20below%20%2229%20OUT%22%3F%3C%2FLI%3E%0A%3CLI%3EThis%20is%20about%20your%20point%203%20%22%3CSPAN%3Eit%20is%20very%20important%20that%20the%20selected%20cells%20remain%20like%20this%20when%20other%20cells%20are%20being%20selected.%22%26nbsp%3B%20I%3C%2FSPAN%3Ef%20we%20selected%20%2223%22%20this%20time%2C%20and%20then%2C%20change%20the%20selection%20to%20%2224%22%2C%20should%20the%20formatting%20in%20the%20cells%20around%2023%20be%20removed%3F%3C%2FLI%3E%0A%3C%2FOL%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%3C%2FLINGO-BODY%3E
New Contributor

Hi all,

I need help with either vba code or formula.

I have a data validation drop down list which contains numbers 1-45.

I am able to select multiple numbers from the drop down list at once.

Look at the middle column. Below RUN No is my drop list. Below this are columns with various numbers and letters. The numbers I am interested in are the black font size 18 (23 for example).

When I select 23 from my drop list I want excel to do the following things.

1. create a border containing the cell with 23 in, the cell to the left, and the block of 4 cells below ending up with a block of cells 2 x 3 inside a border. 

2. highlight the cells within the border.

3. it is very important that the selected cells remain like this when other cells are being selected.

Can anyone help me and point me in the right direction.

 

many thanks

 

Lee

 

Capture.PNG

2 Replies
best response confirmed by lee ashton (New Contributor)
Solution

I would like to have a try, but, your sample doesn't show as what you want. 

 

For example, point 1, after selecting 23, the 4 cells (2x2) below it are not highlighted.   I guess it would look like "18" in your screenshot, but only 2x2cells (including the number row) are highlighted, not 2x3.

 

Also, would you please clarify

  1. If those "RUN NO" are selected, do you mean all the cells contains the "RUN NO"s will be highlighted; or just the cells below that RUN NO will be highlighted?
    What I am asking is, for example, if I select "18" on the "RUN NO" above "29 BACK", should we highlight the "18" which is below "29 OUT"?
  2. This is about your point 3 "it is very important that the selected cells remain like this when other cells are being selected."  If we selected "23" this time, and then, change the selection to "24", should the formatting in the cells around 23 be removed?

 

Hi Willy Lau,

Thank you for your response.

The cells highlighted in yellow have not been selected, but are highlighted for another reason.

If Run No 18 was selected it would have to be shaded in red with 75% grey. It would also be the same as I mentioned, a block of 6 cells 2 wide by 3 high.

Point 1 that you mentioned, only the Run No's selected would be highlighted and have to remain highlighted when other Run No's are selected. This is because other Run No's may be selected at a later stage by the user.

Point 2 that you mentioned, the Data Validation list has the ability to have multiple selections made at once. Therefore I could choose Run No 23 on its own or 23 and 24 together.

The Data Validation selection refers to the numbers in the column directly below.

 

I hope this clarifies things a little better for you.

And once again many thanks for your response I have been trying to get help with this problem for months now.

 

Regards

 

Lee Ashton