Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3
Default access to cell values

excel 2000
i changed some code to use cell names instead of references, which works,
but can't get access to the cell values

original code using cell references:
Sub Worksheet_Change(ByVal Target As Range)
Select Case Target.Address
Case "$O$21", "$O$22", "$E$7"
targetVariable = ActiveSheet.Range("o$22").Value

new code to accomodate using cell names:
Sub Worksheet_Change(ByVal Target As Excel.Range)
Select Case Target.Name.Name
Case "stock_price", "xAxisMax"
targetVariable = ActiveSheet.Range("xAxisMax").Value
....... target variable doesn't get populated but no error msg

seems the 'activeSheetRange...' reference doesn't work due to changing the
'target as range' to 'target as excel.range' - i have some other ways to get
the
cell values but nothing seems to work, i'm stumped


  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3,885
Default access to cell values

Hi
use
target.value


--
Regards
Frank Kabel
Frankfurt, Germany

"msnews" schrieb im Newsbeitrag
...
excel 2000
i changed some code to use cell names instead of references, which

works,
but can't get access to the cell values

original code using cell references:
Sub Worksheet_Change(ByVal Target As Range)
Select Case Target.Address
Case "$O$21", "$O$22", "$E$7"
targetVariable = ActiveSheet.Range("o$22").Value

new code to accomodate using cell names:
Sub Worksheet_Change(ByVal Target As Excel.Range)
Select Case Target.Name.Name
Case "stock_price", "xAxisMax"
targetVariable = ActiveSheet.Range("xAxisMax").Value
...... target variable doesn't get populated but no error msg

seems the 'activeSheetRange...' reference doesn't work due to

changing the
'target as range' to 'target as excel.range' - i have some other ways

to get
the
cell values but nothing seems to work, i'm stumped



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3
Default access to cell values

hi, thanks for the reply and sorry bout the dble post, i'm getting error
msg's for
posts but sometimes like this they go thru anyway

target.value does work for the the cell that invoked the 'worksheet_change'
however, i need to access the cell values of other cells besides the
invoking target
cell within the 'select case' and can't seem to find the code to get those,
the cells i need to access are always in the active sheet, in this case, its
the most practical
means without having to hard code, i don't mind hard coding the cell names.

i would look like this:
Sub Worksheet_Change(ByVal Target As Excel.Range)
Select Case Target.Name.Name
Case "stock_price", "xAxisMax"
targetVariable1 = something?("xAxisMax").Value
targetVariable2 = something?("stock_Price").Value
targetVariable3 = something?("someOtherCellName").Value



"Frank Kabel" wrote in message
...
Hi
use
target.value


--
Regards
Frank Kabel
Frankfurt, Germany

"msnews" schrieb im Newsbeitrag
...
excel 2000
i changed some code to use cell names instead of references, which

works,
but can't get access to the cell values

original code using cell references:
Sub Worksheet_Change(ByVal Target As Range)
Select Case Target.Address
Case "$O$21", "$O$22", "$E$7"
targetVariable = ActiveSheet.Range("o$22").Value

new code to accomodate using cell names:
Sub Worksheet_Change(ByVal Target As Excel.Range)
Select Case Target.Name.Name
Case "stock_price", "xAxisMax"
targetVariable = ActiveSheet.Range("xAxisMax").Value
...... target variable doesn't get populated but no error msg

seems the 'activeSheetRange...' reference doesn't work due to

changing the
'target as range' to 'target as excel.range' - i have some other ways

to get
the
cell values but nothing seems to work, i'm stumped





  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3,885
Default access to cell values

Hi
try for example:
targetVariable2 = Me.Range("A1").Value

--
Regards
Frank Kabel
Frankfurt, Germany

"msnews" schrieb im Newsbeitrag
...
hi, thanks for the reply and sorry bout the dble post, i'm getting

error
msg's for
posts but sometimes like this they go thru anyway

target.value does work for the the cell that invoked the

'worksheet_change'
however, i need to access the cell values of other cells besides the
invoking target
cell within the 'select case' and can't seem to find the code to get

those,
the cells i need to access are always in the active sheet, in this

case, its
the most practical
means without having to hard code, i don't mind hard coding the cell

names.

i would look like this:
Sub Worksheet_Change(ByVal Target As Excel.Range)
Select Case Target.Name.Name
Case "stock_price", "xAxisMax"
targetVariable1 = something?("xAxisMax").Value
targetVariable2 = something?("stock_Price").Value
targetVariable3 = something?("someOtherCellName").Value



"Frank Kabel" wrote in message
...
Hi
use
target.value


--
Regards
Frank Kabel
Frankfurt, Germany

"msnews" schrieb im Newsbeitrag
...
excel 2000
i changed some code to use cell names instead of references,

which
works,
but can't get access to the cell values

original code using cell references:
Sub Worksheet_Change(ByVal Target As Range)
Select Case Target.Address
Case "$O$21", "$O$22", "$E$7"
targetVariable = ActiveSheet.Range("o$22").Value

new code to accomodate using cell names:
Sub Worksheet_Change(ByVal Target As Excel.Range)
Select Case Target.Name.Name
Case "stock_price", "xAxisMax"
targetVariable = ActiveSheet.Range("xAxisMax").Value
...... target variable doesn't get populated but no error msg

seems the 'activeSheetRange...' reference doesn't work due to

changing the
'target as range' to 'target as excel.range' - i have some other

ways
to get
the
cell values but nothing seems to work, i'm stumped






Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
How to lookup values in Access db? 1scant Excel Discussion (Misc queries) 2 June 1st 06 04:04 PM
DCOUNT to Return Values from Access database Tim H Excel Discussion (Misc queries) 5 December 15th 05 10:27 PM
Combo Box Values from Access Table? Fattire Excel Discussion (Misc queries) 0 May 24th 05 06:12 PM
access cell values msnews[_2_] Excel Programming 1 May 27th 04 06:59 PM
Access values from another workbook Grey Excel Programming 2 December 30th 03 05:25 PM


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

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"