View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
Dave Baranas Dave Baranas is offline
external usenet poster
 
Posts: 11
Default Newbie stuck on Passing a Variable into a Range

Thanks Bob, I now see light at the end of the tunnel......just have to
climb through the train wreck:)

Dave

On Tue, 12 Aug 2003 21:52:16 -0400, "Bob Kilmer"
wrote:

Sub Main3()
'Minor variation on Main2
Index = 6
Set rng = Worksheets("Sheet1").Range("A1:D100")
With rng
.Columns(.Columns.Count).Cells(Index) = ComboBox.Value
End With
End Sub

Sub Main4()
'Refers to cell Index in the last column of
'Worksheets("Sheet1").Range("A1:D100").
'Does not use range variable.
Index = 6
With Worksheets("Sheet1").Range("A1:D100")
.Columns(.Columns.Count).Cells(Index) = ComboBox.Value
End With
End Sub