Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 16
Default Dim cells in a sheet as a range

I am using a Select Case statement, and instead of having many Case
statements to cover ALL cell senarios, how can i use a line to 'DIM" an
array of cells?

Rather than something like:

Case Is = Sheet4.range("A1")
' code 1

Case Is = Sheet4.range("C3")
' code 2
Case Is = Sheet4.range("H10")
' code 3 etc............

How can i use some thing like:
Dim sh as Sheet4
Dim rng as Range
Set rng = sh.Cells("A1,C3,H10,...........")

Case Select Sheet1.range("D2").value
Case sh.rng
' code to work for ALL rng senario's....
end Select


How can i Syntax this?


  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 16
Default Dim cells in a sheet as a range

Or maybe use a Defined Range in a sheet of cells instead in the Case
Statement?

"Corey" wrote in message
...
I am using a Select Case statement, and instead of having many Case
statements to cover ALL cell senarios, how can i use a line to 'DIM" an
array of cells?

Rather than something like:

Case Is = Sheet4.range("A1")
' code 1

Case Is = Sheet4.range("C3")
' code 2
Case Is = Sheet4.range("H10")
' code 3 etc............

How can i use some thing like:
Dim sh as Sheet4
Dim rng as Range
Set rng = sh.Cells("A1,C3,H10,...........")

Case Select Sheet1.range("D2").value
Case sh.rng
' code to work for ALL rng senario's....
end Select


How can i Syntax this?



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 16
Default Dim cells in a sheet as a range

Select Case UserForm1.ComboBox2
Case Is = Range("WorkShopRates") ' <= = Named range
MsgBox "W/Shop"
Case Is = Range("SiteRates") ' <= = Named range
MsgBox "Site"
End Select

Works

I think thus far anyhow


Corey....
"Corey" wrote in message
...
I am using a Select Case statement, and instead of having many Case
statements to cover ALL cell senarios, how can i use a line to 'DIM" an
array of cells?

Rather than something like:

Case Is = Sheet4.range("A1")
' code 1

Case Is = Sheet4.range("C3")
' code 2
Case Is = Sheet4.range("H10")
' code 3 etc............

How can i use some thing like:
Dim sh as Sheet4
Dim rng as Range
Set rng = sh.Cells("A1,C3,H10,...........")

Case Select Sheet1.range("D2").value
Case sh.rng
' code to work for ALL rng senario's....
end Select


How can i Syntax this?



  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2,420
Default Dim cells in a sheet as a range

Do you mean

Case Not Intersect(rng, Sheet1.range("D2").Value) Is NOthing

--
__________________________________
HTH

Bob

"Corey" wrote in message
...
I am using a Select Case statement, and instead of having many Case
statements to cover ALL cell senarios, how can i use a line to 'DIM" an
array of cells?

Rather than something like:

Case Is = Sheet4.range("A1")
' code 1

Case Is = Sheet4.range("C3")
' code 2
Case Is = Sheet4.range("H10")
' code 3 etc............

How can i use some thing like:
Dim sh as Sheet4
Dim rng as Range
Set rng = sh.Cells("A1,C3,H10,...........")

Case Select Sheet1.range("D2").value
Case sh.rng
' code to work for ALL rng senario's....
end Select


How can i Syntax this?



  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Dim cells in a sheet as a range

What you can do depends on how similar or different code1, code2, code3,
etc. are. Can you give us some insight into what you are doing here?

Rick


"Corey" wrote in message
...
I am using a Select Case statement, and instead of having many Case
statements to cover ALL cell senarios, how can i use a line to 'DIM" an
array of cells?

Rather than something like:

Case Is = Sheet4.range("A1")
' code 1

Case Is = Sheet4.range("C3")
' code 2
Case Is = Sheet4.range("H10")
' code 3 etc............

How can i use some thing like:
Dim sh as Sheet4
Dim rng as Range
Set rng = sh.Cells("A1,C3,H10,...........")

Case Select Sheet1.range("D2").value
Case sh.rng
' code to work for ALL rng senario's....
end Select


How can i Syntax this?


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
Change range from cells to sheet? JBW Excel Worksheet Functions 1 November 7th 07 03:33 PM
How to transfer text to an sheet if the cells en range contains a mia_kit Excel Discussion (Misc queries) 2 May 24th 07 04:40 PM
Concatenating a range of cells from another sheet, possible? [email protected] Excel Worksheet Functions 7 March 7th 07 04:37 AM
code to copy a range of cells to another sheet Robb27 Excel Programming 7 April 4th 06 11:24 AM
Smallest range on sheet containing non-blank cells? Ken Johnson Excel Programming 4 October 3rd 05 09:48 AM


All times are GMT +1. The time now is 04:54 PM.

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

About Us

"It's about Microsoft Excel"