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
Solved

placing a value on another excel wrk book through vba

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

Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

No matter the version of Windows you are using, you may have some problems with Windows Search running too slow or possibly not running at all. Before jumping into how you can solve this issue, just know there are many other viable alternative deskt…
Do you use a spreadsheet like Microsoft's Excel?  Have you ever wanted to link out to a non excel file on your computer or network drive?  This is the way I found to do it!
Many functions in Excel can make decisions. The most simple of these is the IF function: it returns a value depending on whether a condition you describe is true or false. Once you get the hang of using the IF function, you will find it easier to us…
Although Jacob Bernoulli (1654-1705) has been credited as the creator of "Binomial Distribution Table", Gottfried Leibniz (1646-1716) did his dissertation on the subject in 1666; Leibniz you may recall is the co-inventor of "Calculus" and beat Isaac…

840 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