View Single Post
  #5   Report Post  
Posted to microsoft.public.excel.programming
Joanne Joanne is offline
external usenet poster
 
Posts: 121
Default selecting a range

Works sweet - thank you very much
Also gives me some info on how ws_change works - I am having trouble
figuring out where to put my macro calls so they run when they should
(and only then). I see using an if statement kinda anchors the code so
that it runs only when target.address is = to E10 (in this instance), so
the line of code will not run on other change events using a diff
address. Am I going down the right path?


Lazzzx wrote:

In the module for the relevant sheet, make the following event macro:

Private Sub Worksheet_Change(ByVal Target As Range)
If Target.Address = "$E$10" Then Range("B15").Select
End Sub

rgds

"Joanne" skrev i meddelelsen
...
After I put my data in cell E10, I want to goto cell B15.
What I have here in the procedure in line 3 is the line from a macro I
recorded to try to get an idea how to do this. But this line has the
value i input during recording. I will need to input a different value
on each use of the ws.
I expect I need a variable declared to allow cell value to change, but I
don't have enough knowledge to know exactly how to do it.

I'm thinking that if I declare a variable, then say activecell.value =
Myvariable, that might do it - but this is a newbie guess from other
code I've been reading. If this is right, does the variable name need to
go in the parantheses in the public sub line?

Please help

Public Sub Worksheet_Activate()
Range("E10").Activate
ActiveCell.FormulaR1C1 = "34567"
Range("B15").Select
End Sub

thank you
Joanne