Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.misc
|
|||
|
|||
In VBA, How to Refer to Cell In Specific Column But Selected Rows?
The following macro toggles between shading the selected row(s) gray or, if
they're shaded already, unshading them. (It opens a form to resolve the issue if rows of more than one shade are selected.) Sub ShadeRow() Select Case Selection.Interior.ColorIndex Case Is < 16 Selection.EntireRow.Interior.ColorIndex = 16 Case Is = 16 Selection.EntireRow.Interior.ColorIndex = xlNone Case Else ShadingOptions.Show End Select End Sub It works pretty well. Probably this is a stupid question, but I'd really like the macro to also insert the text "Completed" into the cell in column AH (that is, 34) for whatever row(s) are being shaded. I've tried variations on the Cells property, but I always end up inputing "Completed" into a cell that is relative to the active cell, which isn't what I want. (Further, since it's possible that columns may be added or deleted by users, I suppose that I really should be referring to a vertical named range instead of the actual column number.) I'd appreciate any advice on my stupid little problem! |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Paste Specific Cell to Selected Cell | Excel Worksheet Functions | |||
Printing only Rows with a value in a specific column | Excel Discussion (Misc queries) | |||
Function to return # of column with min value in selected rows | Excel Worksheet Functions | |||
Specific cell selected when sheet opens...how??? | Excel Discussion (Misc queries) | |||
Using 'If' refer to specific words in a cell containing text | Excel Worksheet Functions |