ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Can i use range-object for .object.value= (https://www.excelbanter.com/excel-programming/336042-can-i-use-range-object-object-value%3D.html)

bigburt

Can i use range-object for .object.value=
 
Hello programmers !

Here is my problem :

I wouldlike to put some value into a sheet. the destination cells
depends on the selection. The selection is always type of Range. But i
have to use a conversion to write it down .

Dim bereich as range

AZelle = CStr(ActiveCell.Address)
..
..
..
Worksheets("Protect").Range(AZelle).Value = dteDatum

I dontīt like this . Why canīt i use

Worksheets("Protect").bereich.Value = dteDatum


JE McGimpsey

Can i use range-object for .object.value=
 
First, i don't see where you set bereich.

If you use

Dim bereich As Range
Set bereich = ActiveCell

then you can use

bereich.Value = dteDatum


If bereich is not on Sheet "Protect", then you can use

Worksheets("Protect").Range(bereich.Address).Value = dteDatum

since a range object is a child object of a worksheet, and can't belong
to two different worksheets.


In article .com,
"bigburt" wrote:

Hello programmers !

Here is my problem :

I wouldlike to put some value into a sheet. the destination cells
depends on the selection. The selection is always type of Range. But i
have to use a conversion to write it down .

Dim bereich as range

AZelle = CStr(ActiveCell.Address)
.
.
.
Worksheets("Protect").Range(AZelle).Value = dteDatum

I dontīt like this . Why canīt i use

Worksheets("Protect").bereich.Value = dteDatum


Tom Ogilvy

Can i use range-object for .object.value=
 
Dim bereich as range

set bereich = ActiveCell
..
..
..
..

bereich.Value = dteDatum

--
Regards,
Tom Ogilvy



"bigburt" wrote in message
oups.com...
Hello programmers !

Here is my problem :

I wouldlike to put some value into a sheet. the destination cells
depends on the selection. The selection is always type of Range. But i
have to use a conversion to write it down .

Dim bereich as range

AZelle = CStr(ActiveCell.Address)
..
..
..
Worksheets("Protect").Range(AZelle).Value = dteDatum

I dontīt like this . Why canīt i use

Worksheets("Protect").bereich.Value = dteDatum



Tom Ogilvy

Can i use range-object for .object.value=
 
or, if the activecell is not on sheet protect and you just want to use its
address (and it changes in the "meantime")

Dim bereich as Range
set bereich = ActiveCell

..
..
..

Worksheets("Protect").Range(bereich.Address).Value = dteDatum

--
Regards,
Tom Ogilvy

"bigburt" wrote in message
oups.com...
Hello programmers !

Here is my problem :

I wouldlike to put some value into a sheet. the destination cells
depends on the selection. The selection is always type of Range. But i
have to use a conversion to write it down .

Dim bereich as range

AZelle = CStr(ActiveCell.Address)
..
..
..
Worksheets("Protect").Range(AZelle).Value = dteDatum

I dontīt like this . Why canīt i use

Worksheets("Protect").bereich.Value = dteDatum



bigburt

Can i use range-object for .object.value=
 
Good work,

very fast answer

Thanks a lot
greetings from Germany



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

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