Set range to value from another sheet
Hi Gustaf
I'm not sure if you can apply a value to a whole range without
iterating through it but the code below will do what you want
Option Explicit
Dim MyCell, MyRng As Range
Dim MyStr As String
Private Sub CommandButton1_Click()
Set MyRng = Sheets("Sheet1").[B4:AE4]
MyStr = Cells(2, 1).Value
For Each MyCell In MyRng
MyCell.Value = MyStr
Next
End Sub
Hope this helps
Steve
|