View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Rookie 1st class Rookie 1st class is offline
external usenet poster
 
Posts: 152
Default Test for condition before running macro

I'm running Excel 2003.
Thanks again
Lou

"Rookie 1st class" wrote:

I have 10 named non consecutive ranges Scl1 - Scl10. I am going to create a
Command bar to run a macro based on the current ActiveCell (Selection = Some
value - from a user form). I need to understand how to test that the selected
cell is indeed named Scl* or Scl# (a wildcard will work I think).

If ActiveCell.range = "scl*" then
UserForm.Show


I also need a method for the UserForm to paste tthe data in the selected cell.

Private Sub OptionButton1_Click() 'Private Sub
Range(ActiveCell) = OurMagic

I've tried everyway I can for the test function and have even less hair than
when I started.
TIA
Lou