#1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default ActiveCell

Get a funny problem which was working.

Have the following. I enter 3453 in C15.

in VB have the following

Dim InputRange as Range
Set InputRange = Activecell

This should return C15 (or the active cell address). Instead it keeps
returning 3453.

This was working previously - any ideas - only thing I can think of is
the Excel is 2003-SR1

Desperate to get this working

Thanks

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 292
Default ActiveCell

Your provided code does not return anything, it sets a range, which works,
as in:


Sub Test()
Dim InputRange As Range
Set InputRange = ActiveCell
Range("C14").Select
MsgBox "Will return from C14 to InputRange now."
InputRange.Select
End Sub

What I suspect that you do is not defining which property to use, like

MsgBox InputRange

That lazy coding is only acceptable if you know the object model extremely
well and don't share co de with others. You expect the Address property in
return, but what you get is the Value property if you leave it out:

MsgBox InputRange.Address
MsgBox InputRange.Value
MsgBox InputRange.Font.Name

HTH. Best wishes Harald

skrev i melding
oups.com...
Get a funny problem which was working.

Have the following. I enter 3453 in C15.

in VB have the following

Dim InputRange as Range
Set InputRange = Activecell

This should return C15 (or the active cell address). Instead it keeps
returning 3453.

This was working previously - any ideas - only thing I can think of is
the Excel is 2003-SR1

Desperate to get this working

Thanks



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,058
Default ActiveCell

It is defaulting to the Value.

InputRange.Value should give 3453
and
InputRange.Address should give C15
--
Gary's Student


" wrote:

Get a funny problem which was working.

Have the following. I enter 3453 in C15.

in VB have the following

Dim InputRange as Range
Set InputRange = Activecell

This should return C15 (or the active cell address). Instead it keeps
returning 3453.

This was working previously - any ideas - only thing I can think of is
the Excel is 2003-SR1

Desperate to get this working

Thanks


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
If activecell.column = variable then activecell,offset (0,1) Battykoda via OfficeKB.com Excel Discussion (Misc queries) 1 October 2nd 07 08:05 PM
if activecell is value רוזנט Excel Programming 4 July 11th 06 08:19 PM
IF ACTIVECELL contains FIRSTROUNDKO via OfficeKB.com Excel Programming 4 May 3rd 06 05:17 PM
Name the ActiveCell Vikxcel Excel Programming 1 October 19th 05 01:37 AM
activecell slikity Excel Programming 7 December 13th 04 11:59 AM


All times are GMT +1. The time now is 10:53 PM.

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

About Us

"It's about Microsoft Excel"