ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   How to store additional attributes for a cell (https://www.excelbanter.com/excel-programming/318470-how-store-additional-attributes-cell.html)

Thorsten Walenzyk

How to store additional attributes for a cell
 
Hi all,

I'm looking for a possibility to store some additional attributes for the
cells in my sheet.
My VBA script needs some data for later decission making.
The additional data should not be displayed for to the user.

Does a Cell object has a property which I can use for that purpose?

Thanks a lot, Thorsten



Harald Staff

How to store additional attributes for a cell
 
Hi Thorsten

The only one I can think of is the ID property

Sub test()
Sheets(1).Cells(2, 3).ID = "Harald's cell"
MsgBox Sheets(1).Cells(2, 3).ID
End Sub

But it doesn't save between sessions, so it's useless for storage. Id'
rather write to corresponding cells in a hidden sheet, given that "should
not be displayed" means only that and not that the information is top
secret.

HTH. Best wishes Harald

"Thorsten Walenzyk" skrev i melding
...
Hi all,

I'm looking for a possibility to store some additional attributes for the
cells in my sheet.
My VBA script needs some data for later decission making.
The additional data should not be displayed for to the user.

Does a Cell object has a property which I can use for that purpose?

Thanks a lot, Thorsten





Paul Smith[_3_]

How to store additional attributes for a cell
 
Why not think about store your additional data as a comment in the cell


"Thorsten Walenzyk" wrote in message
...
Hi all,

I'm looking for a possibility to store some additional attributes for the
cells in my sheet.
My VBA script needs some data for later decission making.
The additional data should not be displayed for to the user.

Does a Cell object has a property which I can use for that purpose?

Thanks a lot, Thorsten





Thorsten Walenzyk

How to store additional attributes for a cell
 
The data is definetly not top sectret and must not be stored persistently.
So this sounds sufficient for me.

Thanks Thorsten


"Harald Staff" wrote in message
...
Hi Thorsten

The only one I can think of is the ID property

Sub test()
Sheets(1).Cells(2, 3).ID = "Harald's cell"
MsgBox Sheets(1).Cells(2, 3).ID
End Sub

But it doesn't save between sessions, so it's useless for storage. Id'
rather write to corresponding cells in a hidden sheet, given that "should
not be displayed" means only that and not that the information is top
secret.

HTH. Best wishes Harald

"Thorsten Walenzyk" skrev i melding
...
Hi all,

I'm looking for a possibility to store some additional attributes for

the
cells in my sheet.
My VBA script needs some data for later decission making.
The additional data should not be displayed for to the user.

Does a Cell object has a property which I can use for that purpose?

Thanks a lot, Thorsten







Dana DeLouis[_3_]

How to store additional attributes for a cell
 
Just to mention. If you save your workbook as a Web page (.htm format),
then the .ID property does gets saved with the cell.

--
Dana DeLouis
Win XP & Office 2003


"Thorsten Walenzyk" wrote in message
...
The data is definetly not top sectret and must not be stored persistently.
So this sounds sufficient for me.

Thanks Thorsten


"Harald Staff" wrote in message
...
Hi Thorsten

The only one I can think of is the ID property

Sub test()
Sheets(1).Cells(2, 3).ID = "Harald's cell"
MsgBox Sheets(1).Cells(2, 3).ID
End Sub

But it doesn't save between sessions, so it's useless for storage. Id'
rather write to corresponding cells in a hidden sheet, given that "should
not be displayed" means only that and not that the information is top
secret.

HTH. Best wishes Harald

"Thorsten Walenzyk" skrev i melding
...
Hi all,

I'm looking for a possibility to store some additional attributes for

the
cells in my sheet.
My VBA script needs some data for later decission making.
The additional data should not be displayed for to the user.

Does a Cell object has a property which I can use for that purpose?

Thanks a lot, Thorsten









Thorsten Walenzyk

How to store additional attributes for a cell
 
The data is definetly not top sectret and must not be stored persistently.
So this sounds sufficient for me.

Thanks to Harald ...



I need to store different data and I guess, this is the only property I can
(mis-) use.

I tried something like this:

Public Type MyType
somedata As Integer
someother As String
End Type

Private Sub test()
Dim CellData As MyType
CellData.somedata = 42
CellData.someother = "fourty-two"

Sheets(1).Cells(2, 2).ID = CellData
End Sub


But I've got the error:
"Only user-defined types defined in public object modules can be coerced to
or from a variant or passed to late-bound functions"

As I have defined MyType as a Public type, I guess the problem is the
"public object module".

What is a "public object module" and how can I create one ???

Thanks a lot, Thorsten




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

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