View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Carlos[_6_] Carlos[_6_] is offline
external usenet poster
 
Posts: 14
Default runtime error 1004

Hi JC

The code is OK if PDFs is a active sheet.
if is not try

Dim ws2 As Worksheet
Dim ws2R As Integer
Set ws2 = Worksheets("PDFs")
ws2R = 20
ws2.select
ws2.Range(Cells(1, 1), Cells(ws2R, 9)).Select

"JC" wrote in message
oups.com...


Dim ws2 As Worksheet
Dim ws2R As Integer
Set ws2 = Worksheets("PDFs")
ws2R = 20
ws2.Range(Cells(1, 1), Cells(ws2R, 9)).Select

In the code above I always get runtime error 1004 on the last line.
PDFs is a valid sheet name.
Can someone please tell me why this does not work?
Thank you
- jc -