LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.misc
PBJ PBJ is offline
external usenet poster
 
Posts: 19
Default 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
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Paste Specific Cell to Selected Cell W.Easton Excel Worksheet Functions 6 January 12th 07 08:02 PM
Printing only Rows with a value in a specific column Eric Excel Discussion (Misc queries) 2 August 3rd 06 05:41 PM
Function to return # of column with min value in selected rows mr_espresso Excel Worksheet Functions 9 June 24th 06 08:54 PM
Specific cell selected when sheet opens...how??? Ron M. Excel Discussion (Misc queries) 3 February 17th 06 02:37 AM
Using 'If' refer to specific words in a cell containing text Casino Guy Excel Worksheet Functions 5 August 10th 05 02:02 PM


All times are GMT +1. The time now is 02:18 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"