Microsoft Office Forums

Go Back   Microsoft Office Forums > >

Reply
 
Thread Tools Display Modes
  #1  
Old 10-15-2014, 07:18 PM
mike12 mike12 is offline Search on mouse click ( Excel ) Windows 7 64bit Search on mouse click ( Excel ) Office 2013
Novice
Search on mouse click ( Excel )
 
Join Date: Oct 2014
Location: Brisbane , Australia
Posts: 10
mike12 is on a distinguished road
Default Search on mouse click ( Excel )

hi all,
I logged a thread in the other area with no luck.
I have an excel workbook with two sheets.
Sheet one has a colum of data. Sheet one has the unique values
Sheet two has the same information. sheet 2 has the same info but multiple times.
So simply all i want to do is when i click on a cell in sheet1, i wanted a search to be activated on sheet2 for that data.



Eg there is one colum on sheet1 which contains data.
When i click on any of those cells it will then get that data and search for it on sheet two.

For instance col B in sheet one contains :
1
2
3
4
5
6
Let say i click on the cell that contains 5, then a search for 5 will start on sheet two.
any help would be appreciated.
Reply With Quote
  #2  
Old 10-16-2014, 01:19 AM
mike12 mike12 is offline Search on mouse click ( Excel ) Windows 7 64bit Search on mouse click ( Excel ) Office 2013
Novice
Search on mouse click ( Excel )
 
Join Date: Oct 2014
Location: Brisbane , Australia
Posts: 10
mike12 is on a distinguished road
Default

Come to think of it, also what will work is to have a command button on sheet oethat when selected will get the current active cell on that sheet and then perform a search for it on sheet2. eg the contents in the active cell or selected cell in sheet one is "test" so then i would click the command button and it would look for test in sheet two.
Reply With Quote
  #3  
Old 10-16-2014, 02:09 AM
mike12 mike12 is offline Search on mouse click ( Excel ) Windows 7 64bit Search on mouse click ( Excel ) Office 2013
Novice
Search on mouse click ( Excel )
 
Join Date: Oct 2014
Location: Brisbane , Australia
Posts: 10
mike12 is on a distinguished road
Default

ok so i searched other forum and came up with answer.
Below is the code attached to a command button,

Sub FindCellContent()
Dim Sh As Worksheet, foundCell As Range

'Search for CellContent in all Visible Worksheets
For Each Sh In ActiveWorkbook.Worksheets

If Sh.Visible = xlSheetVisible Then
'If you want to ignore the active sheet unmark the below line
'If ActiveSheet.Name <> Sh.Name Then
Set foundCell = Sh.Cells.Find(What:=ActiveCell, _
After:=ActiveCell, LookIn:=xlFormulas, LookAt:=xlPart, _
SearchOrder:=xlByRows, SearchDirection:=xlNext)

If Not foundCell Is Nothing Then
If foundCell.Address(External:=True) <> _
ActiveCell.Address(External:=True) Then _
Application.Goto foundCell: Exit For
End If

'/If you want to ignore the active sheet
'End If
End If
Next
If foundCell Is Nothing Then _
MsgBox ActiveCell & " not found in this workbook"

End Sub
Reply With Quote
  #4  
Old 10-16-2014, 02:09 AM
mike12 mike12 is offline Search on mouse click ( Excel ) Windows 7 64bit Search on mouse click ( Excel ) Office 2013
Novice
Search on mouse click ( Excel )
 
Join Date: Oct 2014
Location: Brisbane , Australia
Posts: 10
mike12 is on a distinguished road
Default

This has now been solved
Reply With Quote
Reply

Thread Tools
Display Modes


Similar Threads
Thread Thread Starter Forum Replies Last Post
Search on mouse click ( Excel ) Stopping sound on mouse click kenelder PowerPoint 2 04-16-2014 06:52 AM
Search on mouse click ( Excel ) Transition : timings AND mouse click Iluvsodah PowerPoint 1 02-21-2013 05:14 PM
Search on mouse click ( Excel ) Word: have to click mouse before typing -- why? Jen L Word 3 03-29-2012 11:32 AM
Mouse over or click highlighting SavageMind PowerPoint 1 03-19-2012 01:58 PM
Mouse double click problem in part protected sheets rene01 Excel 0 08-25-2010 07:33 AM

Other Forums: Access Forums

All times are GMT -7. The time now is 03:18 AM.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2024, vBulletin Solutions Inc.
Search Engine Optimisation provided by DragonByte SEO (Lite) - vBulletin Mods & Addons Copyright © 2024 DragonByte Technologies Ltd.
MSOfficeForums.com is not affiliated with Microsoft