remote workbook

chris2727272727

Board Regular
Joined
Jul 10, 2005
Messages
152
For Each cell In Range (\\Office_server\My Documents\Thames Valley\[Thames Valley Database.xls]Employee Contacts'!$B$2:$B$144)

i have the above code but it keeps coming up woth an error are all the brackets and comas in the right place
 

Excel Facts

Format cells as date
Select range and press Ctrl+Shift+3 to format cells as date. (Shift 3 is the # sign which sort of looks like a small calendar).
The partial code shows how I would handle this.
Code:
' 1.Refer to ranges like this : Workbooks("Book1.xls").WorkSheets("Sheet1").Range("A1")
' 2.It is bad practice to use MS Reserved Words as variable names (ie. 'Cell')
' PARTIAL CODE
Dim MyRange As Range
Workbooks.Open FileName:="\\Office_server\My Documents\Thames Valley\Thames Valley Database.xls"
Set MyRange = ActiveWorkbook.Worksheets("Employee contacts").Range("B2:B144")
For Each c In MyRange.Cells
'etc
 
Upvote 0

Forum statistics

Threads
1,214,649
Messages
6,120,732
Members
448,987
Latest member
marion_davis

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top