Wrox Programmer Forums
Go Back   Wrox Programmer Forums > Microsoft Office > Excel VBA > Excel VBA
|
Excel VBA Discuss using VBA for Excel programming.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Excel VBA section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old July 3rd, 2013, 09:35 AM
Registered User
 
Join Date: Aug 2011
Posts: 4
Thanks: 1
Thanked 0 Times in 0 Posts
Default Open File copy paste specific cell

Hi,

I would like to do a macro which:

1. looks at a name from a list (in file Names.xls) then
2. opens a file (called Fixings.xls) at the sheet which equals that name then
3. copies text in cell M6 (of file Fixings.xls) and pastes it next to such name (in original file Names.xls).

The file Fixings.xls is found in directory P:\Lonib\Derivative\Fixings.xls

The name in file Names.xls is Apples and it is in cell A10
The sheet to open in Fixings.xls is Apples and the Text in cell M6 is Red.

Let me know if you need any other information.

Thanks,
Nix

 
Old July 30th, 2013, 10:40 PM
Friend of Wrox
 
Join Date: Sep 2005
Posts: 812
Thanks: 1
Thanked 53 Times in 49 Posts
Default

Hi

LEt's go step by step.

You can use VBA's Dir Function (http://vbadud.blogspot.in/2007/05/vb...rectories.html) to get the directories / files

Workbooks.Open will allow you to open the file and .Copy for copying ranges

Cheers
Shasur
__________________
C# Code Snippets (http://www.dotnetdud.blogspot.com)

VBA Tips & Tricks (http://www.vbadud.blogspot.com)





Similar Threads
Thread Thread Starter Forum Replies Last Post
Copy details from the uploaded input file and paste in destination file gvreddyhr Excel VBA 0 February 7th, 2012 11:50 AM
Copy specific data in specific cells of sheet2 yogeshyl Excel VBA 1 May 14th, 2007 07:40 AM
Heighlight specific text when open file in browser salman Classic ASP Databases 1 May 5th, 2004 02:07 PM
Heighlet Specific Word when open file in a browser salman Classic ASP Databases 1 March 30th, 2004 06:30 AM
Heighlet specific Text when open file in browser salman Classic ASP Databases 0 March 30th, 2004 05:57 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.