ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Error 1004 (https://www.excelbanter.com/excel-programming/341656-error-1004-a.html)

Moiz

Error 1004
 
when I type

range("A1").select

I get error 1004

why?

Moiz



Norman Jones

Error 1004
 
Hi Moiz,

The error would occur if the active sheet were not a worksheet but , say, a
chart sheet.


---
Regards,
Norman



"Moiz" wrote in message
...
when I type

range("A1").select

I get error 1004

why?

Moiz




Moiz

Error 1004
 
It seems to accept Worksheets("Sheet1").Cell(1, 1).Select

but not

Range ("A1").Select

Any idea?
(it is not a chart sheet, and the Options/General is not set for RC)

"Norman Jones" wrote in message
...
Hi Moiz,

The error would occur if the active sheet were not a worksheet but , say,
a chart sheet.


---
Regards,
Norman



"Moiz" wrote in message
...
when I type

range("A1").select

I get error 1004

why?

Moiz






Tom Ogilvy

Error 1004
 
It sounds like you have this code in the sheet module of a worksheet other
than Sheet1. If so, that is your problem. Likewise you could solve it with

Worksheets("Sheet1").Range("A1").Select

or

Activesheet.Range("A1").Select

Your solution was qualifying the range reference, not whether it was
Range("a1") or Cells(1,1)

--
regards,
Tom Ogilvy



"Moiz" wrote in message
...
It seems to accept Worksheets("Sheet1").Cell(1, 1).Select

but not

Range ("A1").Select

Any idea?
(it is not a chart sheet, and the Options/General is not set for RC)

"Norman Jones" wrote in message
...
Hi Moiz,

The error would occur if the active sheet were not a worksheet but ,

say,
a chart sheet.


---
Regards,
Norman



"Moiz" wrote in message
...
when I type

range("A1").select

I get error 1004

why?

Moiz








Moiz

Error 1004
 
I found the problem,
It was keeping the focus on a text box, not allowing the selection of a
different worksheet.

Thanks for your help.

Moiz

"Tom Ogilvy" wrote in message
...
It sounds like you have this code in the sheet module of a worksheet other
than Sheet1. If so, that is your problem. Likewise you could solve it
with

Worksheets("Sheet1").Range("A1").Select

or

Activesheet.Range("A1").Select

Your solution was qualifying the range reference, not whether it was
Range("a1") or Cells(1,1)

--
regards,
Tom Ogilvy



"Moiz" wrote in message
...
It seems to accept Worksheets("Sheet1").Cell(1, 1).Select

but not

Range ("A1").Select

Any idea?
(it is not a chart sheet, and the Options/General is not set for RC)

"Norman Jones" wrote in message
...
Hi Moiz,

The error would occur if the active sheet were not a worksheet but ,

say,
a chart sheet.


---
Regards,
Norman



"Moiz" wrote in message
...
when I type

range("A1").select

I get error 1004

why?

Moiz










Tom Ogilvy

Error 1004
 
Obviously that would be problematic for either

cells(1,1).Select
or
Range("A1").Select

But believe what you like.

--
Regards,
Tom Ogilvy

"Moiz" wrote in message
...
I found the problem,
It was keeping the focus on a text box, not allowing the selection of a
different worksheet.

Thanks for your help.

Moiz

"Tom Ogilvy" wrote in message
...
It sounds like you have this code in the sheet module of a worksheet

other
than Sheet1. If so, that is your problem. Likewise you could solve it
with

Worksheets("Sheet1").Range("A1").Select

or

Activesheet.Range("A1").Select

Your solution was qualifying the range reference, not whether it was
Range("a1") or Cells(1,1)

--
regards,
Tom Ogilvy



"Moiz" wrote in message
...
It seems to accept Worksheets("Sheet1").Cell(1, 1).Select

but not

Range ("A1").Select

Any idea?
(it is not a chart sheet, and the Options/General is not set for RC)

"Norman Jones" wrote in message
...
Hi Moiz,

The error would occur if the active sheet were not a worksheet but ,

say,
a chart sheet.


---
Regards,
Norman



"Moiz" wrote in message
...
when I type

range("A1").select

I get error 1004

why?

Moiz













All times are GMT +1. The time now is 05:14 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com