View Single Post
  #5   Report Post  
Posted to microsoft.public.excel.programming
joel joel is offline
external usenet poster
 
Posts: 9,101
Default Activate a Workbook

You are using the aphersand and SET incorrectly

Set CDLastRow = .Sheets("Catalyst Dump").Range("A" &
Rows.Count) _
& .End(xlUp).Row

1) The line should be

CDLastRow = .Sheets("Catalyst Dump").Range("A" & Rows.Count).End(xlUp).Row

2) The & is used to combine two strings like this

a = "Boys"
b = "and"
c = "Girls"

d = a & b & c 'this is "Boys and Girls"

3) The underscore is a line continuation character

You can't do this

& .End(xlUp).Row

The amphsand is wrong

4) You don't neet to have the wrod set since you are returning the ".ROW"
which is a number and not an object.

instead of this
CDLastRow = .Sheets("Catalyst Dump").Range("A" & Rows.Count).End(xlUp).Row

you can do this

set CDLastRow = .Sheets("Catalyst Dump").Range("A" & Rows.Count).End(xlUp)

CDLastRow is the actual last cell (an object) in the above. My original
code is returning a number.