ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Worksheet Functions (https://www.excelbanter.com/excel-worksheet-functions/)
-   -   Hidden Worksheet (https://www.excelbanter.com/excel-worksheet-functions/71244-hidden-worksheet.html)

gti_jobert

Hidden Worksheet
 

Hi all,

I have a sheet that contains all the data for the app, is it possible
to have this sheet hidden but still be able to select the data from it
using vb code?

When i do hide the sheet and use the select code;


Code:
--------------------

Sheets("RelationalData").Select

--------------------


It produces an error - "Select Method of Worksheet Class Failed"

Any suggestions?


--
gti_jobert
------------------------------------------------------------------------
gti_jobert's Profile: http://www.excelforum.com/member.php...o&userid=30634
View this thread: http://www.excelforum.com/showthread...hreadid=511699


Chip Pearson

Hidden Worksheet
 
You can only Select a range on the Active Sheet, and since your
worksheet is hidden, it will never be the Active Sheet. That
said, it is (almost) never necessary to Select anything in VBA.
Perhaps if you fully describe what you want to accomplish,
someone will post a solution that doesn't need a Select.


--
Cordially,
Chip Pearson
Microsoft MVP - Excel
Pearson Software Consulting, LLC
www.cpearson.com


"gti_jobert"
wrote
in message
...

Hi all,

I have a sheet that contains all the data for the app, is it
possible
to have this sheet hidden but still be able to select the data
from it
using vb code?

When i do hide the sheet and use the select code;


Code:
--------------------

Sheets("RelationalData").Select

--------------------


It produces an error - "Select Method of Worksheet Class
Failed"

Any suggestions?


--
gti_jobert
------------------------------------------------------------------------
gti_jobert's Profile:
http://www.excelforum.com/member.php...o&userid=30634
View this thread:
http://www.excelforum.com/showthread...hreadid=511699




Arvi Laanemets

Hidden Worksheet
 
Hi

Both code snippets below work with sheet RelationalData hidden or even very
hidden:

....
ReadValue=ThisWorkbook.Sheets("RelationalData").Ra nge("A1").Value
....
ActiveSheet.Range("A1").Value=ThisWorkbook.Sheets( "RelationalData").Range("A1").Value


--
Arvi Laanemets
( My real mail address: arvi.laanemets<attarkon.ee )


"gti_jobert" wrote
in message ...

Hi all,

I have a sheet that contains all the data for the app, is it possible
to have this sheet hidden but still be able to select the data from it
using vb code?

When i do hide the sheet and use the select code;


Code:
--------------------

Sheets("RelationalData").Select

--------------------


It produces an error - "Select Method of Worksheet Class Failed"

Any suggestions?


--
gti_jobert
------------------------------------------------------------------------
gti_jobert's Profile:
http://www.excelforum.com/member.php...o&userid=30634
View this thread: http://www.excelforum.com/showthread...hreadid=511699





All times are GMT +1. The time now is 03:58 PM.

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