View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.misc
N1KO N1KO is offline
external usenet poster
 
Posts: 60
Default Getting a Cell Value into a Macro!

I have this macro

Sub Group()

Dim Cel As Integer

Range("B5").Select
For Cel = 1 To 115
Range(Selection, Selection.End(xlDown)).Select
Range(Selection, Selection.End(xlToRight)).Select
Selection.Rows.Group
Selection.End(xlDown).Select
Selection.End(xlDown).Select
Next

Range("A1:C1").Select
ActiveSheet.Outline.ShowLevels RowLevels:=1

End Sub

What i need it to do is in the "For Cel = 1 To 115" line is to have the 115
as value from a cell if this is possible.

Example: For Cel = 1 To "E1's value" is this possible?

Do i need to Dim the value in the cell or anything?

Thanks in advance.