Thread: ActiveCell
View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Harald Staff Harald Staff is offline
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