If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

 
Go Back  dBforums > PC based Database Applications > Microsoft Excel > Want to move to another sheet on doubleclicking a cell

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 01-03-06, 08:22
suboor_2000 suboor_2000 is offline
Registered User
 
Join Date: Jan 2006
Posts: 1
Want to move to another sheet on doubleclicking a cell

Hi
I have a small problem. I need to move to another sheet's A1 cell, on double clicking a cell in sheet1.
I've tried my best but could not find an event for a cell. Please help

Regards
Sayyed

Last edited by suboor_2000; 01-03-06 at 08:47.
Reply With Quote
  #2 (permalink)  
Old 01-03-06, 09:38
shades shades is offline
Registered User
 
Join Date: Oct 2003
Posts: 1,091
Howdy, and welcome to the board.

Do you mean like a hyperlink? Click cell A1 on Sheet1. Then go to Insert > Hyperlink. In the resulting dialog box, on the left select "Place in this document". Then on the right, select the sheet where you want to go and above that type in the cell where in that new sheet you want to be.

HTH
__________________
old, slow, and confused
but at least I'm inconsistent!

Rich
(retired Excel 2003 user, 3/28/2008)

How to ask a question on forums
Reply With Quote
  #3 (permalink)  
Old 01-06-06, 13:18
savbill savbill is offline
Registered User
 
Join Date: Feb 2004
Posts: 533
Quote:
Originally Posted by suboor_2000
Hi
I need to move to another sheet's A1 cell, on double clicking a cell in sheet1.
Place this code in the VB of the Worksheet you wan to have the double click action on. The 'If' statement is used to limit the range of the doubleclick action.

Code:
Private Sub Worksheet_BeforeDoubleClick(ByVal Target As Range, Cancel As Boolean)
        If Not Intersect(Target, Range("A1:A20")) Is Nothing Then
            Sheet2.Activate
            ActiveSheet.Range("A1").Select
        Else
            Exit Sub
        End If
End Sub

' You can also refer to a specific range this way for the If condition
If Target.Column = 1 Then
__________________
~

Bill
Reply With Quote
  #4 (permalink)  
Old 02-08-06, 00:19
Fazza Fazza is offline
Registered User
 
Join Date: Feb 2006
Posts: 113
Quote:
I need to move to another sheet's A1 cell, on double clicking a cell in sheet1.
A slight variation on Bill's posting,

Code:
Private Sub Workbook_SheetBeforeDoubleClick(ByVal Sh As Object, _
      ByVal Target As Range, Cancel As Boolean)

    'I've assumed Sheet1 is the code name. If it is the actual sheet name
    'then change the test to
    'If Sh.Name = "Sheet1" Then
    If Sh.CodeName = "Sheet1" Then
        
        Cancel = True
        
        With Sheet2     'The code name of the sheet you want to go to.
            .Activate
            .Range("A1").Select
        End With
    End If

End Sub
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On