Return the value of a manually highlighted cell across a column

excelhelp_hg

New Member
Joined
Mar 2, 2023
Messages
2
Office Version
  1. 2019
Platform
  1. Windows
The request is:
1. Identify a cell that is manually highlighted (no conditional formatting used) in each column
2. Return the value of that highlighted cell in another cell
3. If no cell is highlighted in a column, then return "blank" value

Please see attached example on desired output.
In the attached example:
1. Identify that, Cell A1, for example in Column A is highlighted (I manually highlighted it, so no conditional formatting was used)
2. return the value of that highlighted cell in another cell (A13) in this example
3. Repeat this for columns B through H and return the highlighted cell value in cells B13 through H13
4. Since Columns G & H don't have a highlighted cell, return blank values in G13 & H13.

Willing to write Macros or custom functions for this. Thanks for the help!
 

Attachments

  • excelTest.JPG
    excelTest.JPG
    36.7 KB · Views: 16

Excel Facts

What is the fastest way to copy a formula?
If A2:A50000 contain data. Enter a formula in B2. Select B2. Double-click the Fill Handle and Excel will shoot the formula down to B50000.
Hi,
You can test following event macro
VBA Code:
Private Sub Worksheet_BeforeDoubleClick(ByVal Target As Range, Cancel As Boolean)
If Target.CountLarge > 1 Then Exit Sub
Cells(13, Target.Row).Value = Target.Value
Cancel = True
End Sub
 
Upvote 0
Thank you so much for the prompt follow up. Couple questions:
1. Per attached screenshot, I don't see this macro listed for "sheet82" when I add it and save it. I also have the excel file open
2. Per the other screenshot, I do have other "don't care" data in those columns (cells A17-C17) that i don't want to add to the Column based logic for highlighted cells. In other words, our range for this data on a per column basis is A1-H9. How do we incorporate a specific range in this formula?
 

Attachments

  • excelTest1.JPG
    excelTest1.JPG
    134.3 KB · Views: 14
  • excelTest.JPG
    excelTest.JPG
    43.8 KB · Views: 14
Upvote 0
Since you only have a small range to check, see if this does what you want.

VBA Code:
Sub CheckCellsForColour()
  Dim c As Range
  
  For Each c In Range("A1:H9")
    If Not c.Interior.ColorIndex = xlNone Then Cells(13, c.Column).Value = c.Value
  Next c
End Sub
 
Upvote 0

Forum statistics

Threads
1,214,973
Messages
6,122,534
Members
449,088
Latest member
RandomExceller01

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top