Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 4
Default Import Sheet from Closed Workbook

I can not seem to get this to work right. I found a code sniplet from
Joseph Rubin's site and it works as far as what I want so far, but
where there are blank cells, it puts a 0 (zero) in its place. So I
tried to write something that would find and replace those, well that
took alot of time to run, and usually ended up locking up Excel. I
think it has something to do with the .value = .value but not sure..
can someone take a look and suggest some corrections.

I need it to still open a "browse to" window, instead of hard coding
to a directory, the project this is going in, can be where ever the
user saves it at, so it needs this flexiblity.

For this particular sheet, it can have 10 rows or 100 rows, or more..
so it needs to read all of column A thru H. If there is some way of
reading until the end of the last cell of that sheet then that would
work too.. but columns A thru H are filled out.

Private Sub CommandButton1_Click()
' Gets the data from the Personnel Sheet

GetValuesFromAClosedWorkbook "C:", "Book1.xls", _
"Personnel", "A:H"
End Sub

Sub GetValuesFromAClosedWorkbook(fPath As String, _
FName As String, sName, cellRange As String)

'Code By: Joseph Rubin
'http://www.exceltip.com/st/Getting_Values_From_A_Closed_Workbook_using_VBA_in _Microsoft_Excel/357.html
'11-18-2004

With ActiveSheet.Range(cellRange)
.FormulaArray = "='" & fPath & "\[" & FName & "]" _
& sName & "'!" & cellRange
.Value = .Value
End With

-------

Thanks in advance.

Joe Derr
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2
Default Import Sheet from Closed Workbook

go here
http://www.ozgrid.com/VBA/ExtractFromClosedWorkbook.ht

Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Moving Sheet to Closed Workbook Roger Excel Discussion (Misc queries) 0 January 13th 08 05:16 PM
Import data from a closed workbook David T Excel Discussion (Misc queries) 2 September 17th 07 07:24 PM
Help...Code to copy sheet from closed workbook [email protected] Excel Discussion (Misc queries) 1 March 28th 07 08:52 PM
Consolidation of data from cell in active sheet of closed workbook Neil X Peel Excel Worksheet Functions 3 March 8th 07 02:35 PM
Using Querytable.add to import data from a closed workbook Markus Stolle[_5_] Excel Programming 8 August 3rd 04 08:51 PM


All times are GMT +1. The time now is 01:49 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"