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
 

Some videos you may like

Excel Facts

What is the last column in Excel?
Excel columns run from A to Z, AA to AZ, AAA to XFD. The last column is XFD.

Richie(UK)

MrExcel MVP
Joined
May 17, 2002
Messages
3,329
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
 

johnpfisher9

New Member
Joined
Feb 6, 2003
Messages
14
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
 

Joe4

MrExcel MVP, Junior Admin
Joined
Aug 1, 2002
Messages
56,651
Office Version
  1. 365
Platform
  1. Windows
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
 

Watch MrExcel Video

Forum statistics

Threads
1,127,583
Messages
5,625,622
Members
416,124
Latest member
DeMoNloK

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
Top