select case syntax???

Pesky_Weasel

Board Regular
Joined
Sep 28, 2002
Messages
99
Dear All,

I have a select case statement to try to select a range of cells (to copied and pasted elsewhere). I have declared rng as Range
~~~~~~~~~~~~excerpt~~~~~~~~~~~~
Select Case jd
Case "Worker"
rng = Range(("data!b4"), Range("data!c192"))
Case "Manager"
rng = Range(("data!d4"), Range("data!e192"))
Case "Host"
rng = Range(("data!f4"), Range("data!g192"))
Case "Host Supervisor"
rng = Range(("data!h4"), Range("data!i192"))
Case "Executive Manager"
rng = Range(("data!j4"), Range("data!k192"))

End Select

~~~~~~~~~excerpt~~~~~~~~~~~~

This does not seem to work.
Please let me know how badly i have screwed up the syntax.

Thanks for looking
Weasel
 

Some videos you may like

Excel Facts

Shade all formula cells
To shade all formula cells: Home, Find & Select, Formulas to select all formulas. Then apply a light fill color.

phantom1975

MrExcel MVP
Joined
Jun 3, 2002
Messages
3,962
You have to use the SET command when declaring a range

Set mg = Range("A1")

Did this do the trick?
 

Pesky_Weasel

Board Regular
Joined
Sep 28, 2002
Messages
99
Phantom,

I did try this once but probably screwed the syntax up for that too. I will try again later and repost if no good.

Thanks for the help
Weasel
 

Watch MrExcel Video

Forum statistics

Threads
1,122,335
Messages
5,595,573
Members
413,996
Latest member
mabelO

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Top