Solved

placing a value on another excel wrk book through vba

Posted on 2012-04-08
2
209 Views
Last Modified: 2012-04-14
i have 2 workbooks
wrkA  and wrkB
what i have is an open workbook wrkA open and running with some code on it
and with the press of a macro button i wish to put a number eg "76767" on wrkB sheet1 position A1
i do not want to run links on the sheet it needs to be through VB
thats it all i need to be able to do i can then work out the syntax from there
0
Comment
Question by:sydneyguy
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
2 Comments
 
LVL 42

Accepted Solution

by:
dlmille earned 500 total points
ID: 37822241
You can do this.  I'm assuming you have to open wkbB:

Sub doWork()
Dim wkbA As Workbook
Dim wkbB As Workbook

    Set wkbA = ActiveWorkbook
    Set wkbB = Workbooks.Open(Filename:="I:\WoronoraForecast\bookb.xls")
    
    wkbB.Worksheets("Sheet1").Range("A1").Value = "76767"
    'wkbB.Close SaveChanges:=True 'uncomment to save wkbB
End Sub

Open in new window

0
 

Author Closing Comment

by:sydneyguy
ID: 37846249
thanks for the  help dlmille up and going
0

Featured Post

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

You need to know the location of the Office templates folder, so that when you create new templates, they are saved to that location, and thus are available for selection when creating new documents.  The steps to find the Templates folder path are …
My attempt to use PowerShell and other great resources found online to simplify the deployment of Office 365 ProPlus client components to any workstation that needs it, regardless of existing Office components that may be needing attention.
This Micro Tutorial demonstrate the bugs in Microsoft Excel for Mac with Pivot Charts.
This Micro Tutorial will demonstrate how to use longer labels with horizontal bar charts instead of the vertical column chart.

738 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question