Help with automatically opening another worksheet

K

Kirby

Hi all,

Is there a comand to switch from one worksheet to another in a workbook?
I've got users updating a cell on sheet1 and double clicking to pass that
info on to sheet2 and sheet3. They then have to manually open sheet3, I'd
like to open sheet3 automatically if possible. I've tried Goto, Switchto,
Open, Activate with no luck and haven't been able to find what i'm looking
for in the help screens (i'm sure it's there, it just didn't jump off the
page and slap me in the head)
Here's the code i'm running;

Private Sub Worksheet_BeforeDoubleClick(ByVal Target As Range, Cancel As
Boolean)

If Me.Cells(Target.Row, "B").Value <> "" Then

Me.Cells(Target.Row, "B").Resize(, 9).Copy _
Worksheets("LINK").Range("B3")

End If
End Sub


Thank you in advance
Kirby
 
B

Bob Phillips

Private Sub Worksheet_BeforeDoubleClick(ByVal Target As Range, Cancel As
Boolean)

If Me.Cells(Target.Row, "B").Value <> "" Then

Me.Cells(Target.Row, "B").Resize(, 9).Copy _
Worksheets("LINK").Range("B3")

Application.Goto Worksheets("Sheet3").Range("A1")
End If
End Sub
 
M

Mike H

Maybe this which is a bit simpler

Private Sub Worksheet_BeforeDoubleClick(ByVal Target As Range, Cancel As
Boolean)
If Target.Value <> "" Then
Target.Resize(, 9).Copy Worksheets("LINK").Range("B3")
Sheets("LINK").Select
End If
End Sub

Mike
 
D

Don Guillett

You probably DONT need to goto sheet 3 but

Private Sub Worksheet_BeforeDoubleClick(ByVal Target As Range, Cancel As
Boolean)

If Me.Cells(Target.Row, "B").Value <> "" Then

Me.Cells(Target.Row, "B").Resize(, 9).Copy _
Worksheets("LINK").Range("B3")

'copy to sheet 3 & goto sheet3
Me.Cells(Target.Row, "B").Resize(, 9).Copy _
Worksheets("sheet3").Range("B3")
application.goto sheets("sheet3").range("b3")

End If
End Sub
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top