Microsoft Office Forums

Go Back   Microsoft Office Forums > >

Reply
 
Thread Tools Display Modes
  #1  
Old 05-06-2018, 08:37 AM
p45cal's Avatar
p45cal p45cal is offline Need Help to Run an Existing Macro From Current Workbook to Another Workbook Windows 10 Need Help to Run an Existing Macro From Current Workbook to Another Workbook Office 2010 32bit
Expert
 
Join Date: Apr 2014
Posts: 956
p45cal has a reputation beyond reputep45cal has a reputation beyond reputep45cal has a reputation beyond reputep45cal has a reputation beyond reputep45cal has a reputation beyond reputep45cal has a reputation beyond reputep45cal has a reputation beyond reputep45cal has a reputation beyond reputep45cal has a reputation beyond reputep45cal has a reputation beyond reputep45cal has a reputation beyond repute
Default

Without having tested, change the these lines:
Code:
Sub testing()
Dim ws As Worksheet, fndRng As Range
For Each ws In ThisWorkbook.Sheets
to:
Code:
Sub testing(wkbook)
Dim ws As Worksheet, fndRng As Range 
For Each ws In wkbook.Sheets
then you can call your testing procedure in several ways, eg.:
Code:
testing Workbooks("PPE102815.xlsm")
or:
Code:
Set wkb = Workbooks.Open("G:\1. Payroll Files\2016\PPE102815.xls")
testing wkb

Reply With Quote
Reply



Similar Threads
Thread Thread Starter Forum Replies Last Post
Sharing a Workbook that contains array formula link to other workbook Ahmad.rage22@gmail.com Excel 0 03-12-2018 10:15 PM
data entered in one workbook should be updated in other relevant workbook based on the date vedha Excel 0 04-24-2015 08:45 PM
How to add attached excel workbook with hyperlink in the same workbook lynchbro Excel Programming 0 02-24-2015 01:29 PM
Range(Cell1,Cell2) Error on another workbook controlling some other workbook? tinfanide Excel Programming 1 02-09-2012 04:08 PM
Need Help to Run an Existing Macro From Current Workbook to Another Workbook macro to transfer data from one workbook to another workbook virsojour Excel Programming 5 02-01-2011 08:58 PM

Other Forums: Access Forums

All times are GMT -7. The time now is 05:30 AM.


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