ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   access cell values (https://www.excelbanter.com/excel-programming/299692-access-cell-values.html)

msnews[_2_]

access cell values
 
for excel 2000

had this code working fine:
Sub Worksheet_Change(ByVal Target As Range)
Select Case Target.Address
Case "$O$21", "$O$22", "$E$7"
targetVariable = ActiveSheet.Range("o$22").Value

then changed code to accomodate using cell names to this:
Sub Worksheet_Change(ByVal Target As Excel.Range)
Select Case Target.Name.Name
Case "stock_price", "xAxisMax"
targetVariable = ActiveSheet.Range.("xAxisMax").value
..... the targetVariable doesn't get populated but there is no error msg

i have tried a bunch of different ways to get the data from the changed
cells from the worksheet_change/select case combinations but nothing seems
to work, it seems i need some other code than 'ActiveSheetRange....' syntax,
it seems to have something to do with changing 'target as range' to 'target
as excel.range'



Frank Kabel

access cell values
 
Hi
see your other post

--
Regards
Frank Kabel
Frankfurt, Germany

"msnews" schrieb im Newsbeitrag
...
for excel 2000

had this code working fine:
Sub Worksheet_Change(ByVal Target As Range)
Select Case Target.Address
Case "$O$21", "$O$22", "$E$7"
targetVariable = ActiveSheet.Range("o$22").Value

then changed code to accomodate using cell names to this:
Sub Worksheet_Change(ByVal Target As Excel.Range)
Select Case Target.Name.Name
Case "stock_price", "xAxisMax"
targetVariable = ActiveSheet.Range.("xAxisMax").value
.... the targetVariable doesn't get populated but there is no error

msg

i have tried a bunch of different ways to get the data from the

changed
cells from the worksheet_change/select case combinations but nothing

seems
to work, it seems i need some other code than 'ActiveSheetRange....'

syntax,
it seems to have something to do with changing 'target as range' to

'target
as excel.range'





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

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