Microsoft Office Forums

Go Back   Microsoft Office Forums > >

Reply
 
Thread Tools Display Modes
  #1  
Old 05-11-2017, 06:49 AM
Sears36 Sears36 is offline Writing a Macro which will search for the content of a cell rather than it's value Windows 7 64bit Writing a Macro which will search for the content of a cell rather than it's value Office 2013
Novice
Writing a Macro which will search for the content of a cell rather than it's value
 
Join Date: May 2017
Posts: 1
Sears36 is on a distinguished road
Default Writing a Macro which will search for the content of a cell rather than it's value

Hi,
The title may sound a little contradictory, but allow me to explain.
I need to write a large macro which, as it's starting point, will search for the contents of a cell. I say content because the value of the cell will change regularly and I need to be able to search on the new value each time I run the macro.
I tried starting a macro recording then pasting the cell's value into the Find box, however the macro only retains the specific value for which I searched (example below).


Code:
Sub TEST4()
'
' TEST4 Macro
'
'
    Range("B5").Select
    Selection.Copy
    Sheets("Sheet2").Select
    Cells.Find(What:="ARH1", After:=ActiveCell, LookIn:=xlFormulas, LookAt _
        :=xlPart, SearchOrder:=xlByRows, SearchDirection:=xlNext, MatchCase:= _
        False, SearchFormat:=False).Activate
End Sub
There must be function will allows me to search for, something like, ="=B5"
Any help much appreciated!
Reply With Quote
  #2  
Old 05-11-2017, 07:55 AM
NoSparks NoSparks is offline Writing a Macro which will search for the content of a cell rather than it's value Windows 7 64bit Writing a Macro which will search for the content of a cell rather than it's value Office 2010 64bit
Excel Hobbyist
 
Join Date: Nov 2013
Location: British Columbia, Canada
Posts: 831
NoSparks is just really niceNoSparks is just really niceNoSparks is just really niceNoSparks is just really niceNoSparks is just really nice
Default

Quote:
There must be function will allows me to search for, something like, ="=B5"
Code:
What:=Range("B5").value
Reply With Quote
Reply



Similar Threads
Thread Thread Starter Forum Replies Last Post
Macro to save docx to doc that checks compatibility and converts content controls to static content. staicumihai Word VBA 4 10-12-2016 08:23 PM
Writing a Macro which will search for the content of a cell rather than it's value Cell Background Color: Base it on Content of Cell? tatihulot Excel 4 08-14-2013 03:24 PM
Looking for Windows Search app with ability to search by content gopher_everett Office 1 02-28-2013 09:23 PM
Writing a Macro in VBA johnny51981 Project 1 06-22-2011 02:17 AM
Macro Writing cweachter Excel 0 08-09-2008 08:30 PM

Other Forums: Access Forums

All times are GMT -7. The time now is 10:20 PM.


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