Public Schedule Face-to-Face & Online Instructor-Led Training - View dates & book

import data closed workbook

Forum home » Delegate support and help forum » Microsoft Excel VBA Training and help » Import data from a closed workbook

Import data from a closed workbook

ResolvedVersion 2003

Daren has attended:
Excel VBA Intro Intermediate course

Import data from a closed workbook

I require an excel sheet to inport data from another closed workbook
The programming below works fine, but the source date is currently placed within the active workbook, called "AreaName".
The information needs to be imported from the sheet1 on a closed Excel workbook

Can you help, Thank you


I nPublic Sub CmdButtonOK_Click()

SiteName = CmbSiteSelect

intTargetRowCount = 80 'This is the row 10 were the information is placed.

IntNumRows = Sheets(AreaName).Range("A2").CurrentRegion.Rows.Count
'Using 'current Region' selects the all the data starting from cell A on the 2nd
'row to the end of the data i,e to cell "J526"

For introwcount = 1 To IntNumRows 'This tell the count to move along by cell

If Sheets(AreaName).Range("A2").Cells(introwcount, 11).Value = SiteName Then
'look for the specified name, in row 11, in the range from cell A2 in the
'worksheet 'Poplar'.

For intcolumnCount = 8 To 23

Sheets("DataSheet").Cells(intTargetRowCount, intcolumnCount - 7).Value = _
Sheets(AreaName).Range("A2").Cells(introwcount, intcolumnCount).Value

Next intcolumnCount

intTargetRowCount = intTargetRowCount + 1

End If

Next introwcount

Unload UserForm1eed it

RE: Import data from a closed workbook

Hi Daren

Thanks for your post, I will need to run this by one of our VBA trainers, they are extremely busy at the moment but hope to catch up later today so we should be able to let you know if we can assist by tomorrow.

Kind regards

Jacob

RE: Import data from a closed workbook

Hi Darren

I have discussed your post with one of my colleagues and to be reasonably confident we can assist will be beyond the scope of this forum.

I shall contact you directly so that you can send me a copy of your working file.

We can have a look at possible solutions, this may incur some development time, but we will let know first.

Kind regards

Jacob

 

Training courses

Training information:

Welcome. Please choose your application (eg. Excel) and then post your question.

Our Microsoft Qualified trainers will then respond within 24 hours (working days).

Frequently Asked Questions
What does 'Resolved' mean?

Any suggestions, questions or comments? Please post in the Improve the forum thread.

Excel tip:

Enter formulae into multiple cells

If a formula is to be used in a series of cells, select the cells first. Now type in your formula and hold the Ctrl key while you press Enter. This enters the formula in each selected cell.

Just be careful with your absolute and relative cell references.

View all Excel hints and tips

Connect with us:

0207 987 3777

Call for assistance

Request Callback

We will call you back

Server loaded in 0.09 secs.