Basic Macro query

johnpfisher9

New Member
Joined
Feb 6, 2003
Messages
14
Is there anyway to use macro's to perform functions already included within toolbars?

Eg

I want to insert a button onto the worksheet that when pressed will search the entire workbook for the taxt entered in a specific cell?

I also need to have a button that when pressed will automatically bring up the dataform data entry box?

any help would be greatly appreciated

John
 

Excel Facts

Remove leading & trailing spaces
Save as CSV to remove all leading and trailing spaces. It is faster than using TRIM().
Hi John,

Use the Macro Recorder to record the actions that you want to perform then review the code. You should get something like this:
Code:
Sub Macro2()
'
' Macro2 Macro
' Macro recorded 18/03/2004 by Richie
'

'
    ActiveSheet.ShowDataForm
End Sub

Sub Macro3()
'
' Macro3 Macro
' Macro recorded 18/03/2004 by Richie
'

'
    Cells.Find(What:="r", After:=ActiveCell, LookIn:=xlFormulas, LookAt:= _
        xlPart, SearchOrder:=xlByRows, SearchDirection:=xlNext, MatchCase:=False) _
        .Activate
End Sub
HTH
 
Upvote 0
Thanks Richie

I have copied + pasted your codes into VB.

Macro 2 works fine - thankyou very much.

Macro 3 appears to look for the first cell containing 'r'. The function I wish to perform is that the macro will search for the data entered into cell D5 in the rest of the workbook.

Any ideas?

many thanks

John
 
Upvote 0
Modifying Richie's code, try:

Code:
Sub Macro3() 
' 
' Macro3 Macro 
' Macro recorded 18/03/2004 by Richie 
' 

' 
    Dim myFind
    myFind=Range("D5").Value

    Cells.Find(What:=myFind, After:=ActiveCell, LookIn:=xlFormulas, LookAt:= _ 
        xlPart, SearchOrder:=xlByRows, SearchDirection:=xlNext, MatchCase:=False) _ 
        .Activate 
End Sub
 
Upvote 0

Forum statistics

Threads
1,214,649
Messages
6,120,733
Members
448,987
Latest member
marion_davis

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top