View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
a94andwi[_20_] a94andwi[_20_] is offline
external usenet poster
 
Posts: 1
Default Selecting the right cells....


Hello.

I try to select a range but the macro is hard coded into a specific
range. I want it to be flexible depending on the number of rows.
How do I do this?
Here is the macro:

Code:
--------------------
Sub C612ToYellow()
'
' C612ToYellow Macro
' Macro recorded 2006-03-03 by ks32480
'
' Keyboard Shortcut: Ctrl+Shift+E
'
Range("A3").Select
Range(Selection, Selection.End(xlDown)).Select
Range("A3:O70").Select
With Selection.Interior
.ColorIndex = 36
.Pattern = xlSolid
End With
Range("A3").Select
Selection.End(xlDown).Select

End Sub
--------------------

I want to remove the A3:O70 part. Instead I want the selection to
select all rows were there are inputs from column A to O.

How should I write this code?

Thanks
/Anders


--
a94andwi
------------------------------------------------------------------------
a94andwi's Profile: http://www.excelforum.com/member.php...o&userid=21077
View this thread: http://www.excelforum.com/showthread...hreadid=519692