LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #2   Report Post  
Posted to microsoft.public.excel.programming
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

 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Filter Range on Sheet B Based on List on Sheet A Brent E Excel Discussion (Misc queries) 4 April 23rd 07 04:10 PM
How do I edit a selected range then copy the range into an new sheet??? dwyborn Excel Programming 2 December 16th 05 04:11 PM
HELP CONSOLIDATING SAME RANGE EACH SHEET TO SEPARATE SHEET AND RANGE Excel Discussion (Misc queries) 1 June 24th 05 06:31 PM
HELP CONSOLIDATING SAME RANGE EACH SHEET TO SEPARATE SHEET AND RANGE No Name Excel Programming 1 June 24th 05 05:57 PM
HELP CONSOLIDATING SAME RANGE EACH SHEET TO SEPARATE SHEET AND RANGE Excel Worksheet Functions 0 June 24th 05 05:27 PM


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

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"