Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 410
Default Multiple Ranges = same value

I have 3 ranges, that I want to = the same number. I am doing this
with VBA. Is there an easier way then
Range("A3") = 5
Range("A9") = 5
Range"E42")=5
??
Thanks,
Jay
  #2   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 11,058
Default Multiple Ranges = same value

Sub servient()
Range("A3,A9,E42").Value = 5
End Sub

another way is to use Union()

I think that with regard to speed, it does not matter.
--
Gary''s Student - gsnu2007k


"jlclyde" wrote:

I have 3 ranges, that I want to = the same number. I am doing this
with VBA. Is there an easier way then
Range("A3") = 5
Range("A9") = 5
Range"E42")=5
??
Thanks,
Jay

  #3   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 410
Default Multiple Ranges = same value

On Dec 3, 10:29*am, Gary''s Student
wrote:
Sub servient()
Range("A3,A9,E42").Value = 5
End Sub

another way is to use Union()

I think that with regard to speed, it does not matter.
--
Gary''s Student - gsnu2007k



"jlclyde" wrote:
I have 3 ranges, that I want to = the same number. *I am doing this
with VBA. *Is there an easier way then
Range("A3") = 5
Range("A9") = 5
Range"E42")=5
??
Thanks,
Jay- Hide quoted text -


- Show quoted text -


Thanks. I was trying Range("A3", "A9", "E42"). this will be much
easier!
Jay
  #4   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 35,218
Default Multiple Ranges = same value

Except for the typo <vbg, that looks the easiest to me.

But you could use:
ActiveSheet.Range("a3,a9,e42").Value = 5

This worked in xl2003.

jlclyde wrote:

I have 3 ranges, that I want to = the same number. I am doing this
with VBA. Is there an easier way then
Range("A3") = 5
Range("A9") = 5
Range"E42")=5
??
Thanks,
Jay


--

Dave Peterson
Reply
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
Multiple IF statements looking up multiple ranges. mike Excel Worksheet Functions 7 August 9th 07 04:55 PM
Can I create Multiple passwords to edit multiple ranges? Conker10382 Excel Discussion (Misc queries) 8 December 31st 06 07:58 PM
How do i update multiple data ranges across multiple worksheets? mwah Excel Discussion (Misc queries) 0 July 6th 06 04:57 AM
multiple pivot ranges BorisS Excel Worksheet Functions 0 September 16th 05 02:34 PM
Multiple Ranges for a Chart Barb R. Charts and Charting in Excel 0 May 31st 05 11:52 PM


All times are GMT +1. The time now is 07:38 PM.

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"