Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Westi on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

pulling values from a xlsheethidden sheet

Status
Not open for further replies.

davefish

Technical User
Jul 26, 2002
169
GB
I wish to pull some data from an excel sheet that's hidden using the following code. The problem I have is that the sheet is displayed for a short period of time, and that's something I need to rectify. Can anyone help with this?

Public Sub costit()

Sheet3.Visible = xlSheetVisible

With ActiveWorkbook.Sheets("CostS").Activate


MyValues.OPC = [e2].Value
MyValues.Modbus = [e3].Value
MyValues.DNP3 = [e4].Value
MyValues.IEC = [e5].Value
MyValues.INDZ64 = [e6].Value
MyValues.INDZ128 = [e7].Value
MyValues.INDZ256 = [e8].Value
MyValues.INDZ512 = [e9].Value
MyValues.INDZ1024 = [e10].Value
MyValues.INDZ2048 = [e11].Value
MyValues.INDZ4096 = [e12].Value
MyValues.INDZ8192 = [e13].Value
MyValues.INDZ16384 = [e14].Value
MyValues.IND32 = [e15].Value
MyValues.IND64 = [e16].Value
MyValues.IND128 = [e17].Value
MyValues.IND256 = [e18].Value
MyValues.IND512 = [e19].Value
MyValues.IND1024 = [e20].Value
MyValues.CD = [e21].Value
MyValues.Dongle = [e22].Value
MyValues.Config_T = [e23].Value


End With
Sheet3.Visible = xlSheetHidden

End Sub


DaveFish
 
Hi,

You do not need to make the sheet visible!
Code:
MyHiddenSheetObject.[A1].value = "Hidden, 'Hello!'"
msgbox MyHiddenSheetObject.[A1].value


Skip,

[glasses]Just traded in my old subtlety...
for a NUANCE![tongue]
 
Sorry Skip, I#m beingf think at the moment! I'm trying to get the value of Cell A2 which is text OPC and wish to pass it to MyValues.OPC Do you mean

Sheet3 is named "CostS"

Public Sub costit()

With ActiveWorkbook.Sheets("CostS").Activate

MyValues.OPC = sheet3.[A1].value

End With

??

DaveFish
 
What I meant is that the hidden sheet does not need to be unhidden or visible or active to manipulate the objects on it.

Skip,

[glasses]Just traded in my old subtlety...
for a NUANCE![tongue]
 
Hi Skip,

Thanks for your help. So simple and I missed it!

DaveFish
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top