VBA formula query based on a text for surch of a tab

SJO

New Member
Joined
Jul 30, 2020
Messages
1
Office Version
  1. 365
Platform
  1. Windows
Hello, first please excuse my ignorance I am a beginner!
I’ve used the automatic recording VBA process, but I would like to add a true condition on a text in cell to search a tab name in another file. How can I add this formula? Many thanks
Text_value.png

Tab_value.png

Sub MacroTEST1()
'
' MacroTEST1 Macro
'

'
Windows("EPCR_Mastercard report SJO 20_21.xlsx").Activate
Workbooks.Open Filename:= _
"C:\Users\UserName\Documents\Mastercard\TEST\EPCR_Mastercard report SJO 20_21.xlsx"
Range("A12:D41").Select
Selection.Copy
Windows("New MatserCard_global_TEST.xlsm").Activate
Sheets("SJO").Select
Range("A12").Select
ActiveSheet.Paste
Application.CutCopyMode = False
ActiveWorkbook.Save
Sheets("Synthèse").Select
ActiveWorkbook.Save
End Sub
 
Last edited by a moderator:

Excel Facts

How to calculate loan payments in Excel?
Use the PMT function: =PMT(5%/12,60,-25000) is for a $25,000 loan, 5% annual interest, 60 month loan.
Can you give an example of text you'd like to search for and the context in which you would use that to search in a different workbook?
 
Upvote 0

Forum statistics

Threads
1,215,833
Messages
6,127,156
Members
449,367
Latest member
w88mp

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