Solved

placing a value on another excel wrk book through vba

Posted on 2012-04-08
2
215 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

Technology Partners: 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

Microsoft Office Picture Manager was included in Office 2003, 2007, and 2010, but not in Office 2013. Users had hopes that it would be in Office 2016/Office 365, but it is not. Fortunately, the same zero-cost technique that works to install it with …
In Part II of this series, I will discuss how to identify all open instances of Excel and enumerate the workbooks, spreadsheets, and named ranges within each of those instances.
This Micro Tutorial demonstrates how to create Excel charts: column, area, line, bar, and scatter charts. Formatting tips are provided as well.
This Micro Tutorial will demonstrate in Microsoft Excel how to add style and sexy appeal to horizontal bar charts.

623 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