A Microsoft Office (Excel, Word) forum. OfficeFrustration

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

Go Back   Home » OfficeFrustration forum » Microsoft Excel » Worksheet Functions
Site Map Home Register Authors List Search Today's Posts Mark Forums Read  

Open multiple spreadsheets and pull data



 
 
Thread Tools Display Modes
  #1  
Old April 20th, 2010, 09:53 PM posted to microsoft.public.excel.worksheet.functions
vbtrying
external usenet poster
 
Posts: 1
Default Open multiple spreadsheets and pull data

I'm writing an update routine that keeps 2 EXCEL 2010 spreadsheets in-sync.
I'm using this code to open the first spreadsheet and read data into variable:

Workbooks.Open ("\\server\share\Spreadsheet1.xlsx")
set rgePROGRESS = Worksheets("xxxx").Range("A2:C341")

(code works fine)

Then I read local (or try to read) spreadsheet:

Dim AddressSheet As Worksheet
Set AddressSheet = Worksheets("Dups")
FinalRow = AddressSheet.Cells(65536, 2).End(xlUp).Row
Set rgeDUPS = Worksheets("Dups").Range("A2:I" & FinalRow)

(code works fine)

The following code fails by trying to write into a worksheet called "Dups"
on the network spreadsheet:

For i = 1 To rgeDUPS.Rows.Count
wellno = rgeDUPS.Cells(i, 3).Value

For k = 1 To rgePROGRESS.Rows.Count
If rgePROGRESS.Cells(k, 1).Value = wellno Then
Worksheets("Dups").Cells(i, 8).Value = rgePROGRESS.Cells(k,
3).Value
End If
Next k

Next i



Thanks for any help . . .
 




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump


All times are GMT +1. The time now is 11:29 AM.


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