xl2004 VBA code layout

A

Aussie_Bob_C

Version: 2004
Operating System: Mac OS X 10.5 (Leopard)
Processor: Intel

Hi

I'm new to xl2004 for Mac VBA.
In the following Dim & Set statements a Run-Time error (9) Subscript out of Range comes up on the second Set line which is the second sheet.
Is the code syntax different in xl2004 VBA?

Dim wsDvd As Worksheet ' DVD Titles
Dim wsTdx As Worksheet ' Title Index List

Set wsDvd = Worksheets("DVD Titles")
Set wsTdx = Worksheets("Title Index List")

I'm trying to speed up the macro by not using Select whilst transferring data from one sheet to a second sheet and vice-versa.

Example:

wsDvd.Range("D29").Value = wsTdx.Range("C3").Value

TIA

Bob C
 
A

Aussie_Bob_C

Please forget the above question.

I had a stray space on the end of second sheet Tab name.
So the second set statement

Set wsTdx = Worksheets("Title Index List")

could not locate the sheet.

Had I made the same mistake in the second set statement i.e.

Set wsTdx = Worksheets("Title Index List ")

every thing would have been sweet.

It's the little things that catch you out:)

cheers Bob C
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top