Solved

placing a value on another excel wrk book through vba

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

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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
splitting text of cell to columns 14 25
Copy value from a certain cell 5 25
Dynamic Filter ? 4 22
Macro Lookup 33 0
Entering a date in Microsoft Access can be tricky. A typo can cause month and day to be shuffled, entering the day only causes an error, as does entering, say, day 31 in June. This article shows how an inputmask supported by code can help the user a…
Some code to ensure data integrity when using macros within Excel. Also included code that helps secure your data within an Excel workbook.
This Micro Tutorial will demonstrate how to use a scrolling table in Microsoft Excel using the INDEX function.
This is Part 3 in a 3-part series on Experts Exchange to discuss error handling in VBA code written for Excel. Part 1 of this series discussed basic error handling code using VBA. http://www.experts-exchange.com/videos/1478/Excel-Error-Handlin…

863 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

Need Help in Real-Time?

Connect with top rated Experts

24 Experts available now in Live!

Get 1:1 Help Now