View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Incidental Incidental is offline
external usenet poster
 
Posts: 226
Default 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