ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Newbie stuck on Passing a Variable into a Range (https://www.excelbanter.com/excel-programming/274282-re-newbie-stuck-passing-variable-into-range.html)

Dave Baranas

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




All times are GMT +1. The time now is 08:36 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
ExcelBanter.com