ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Return cell co-ordinates (https://www.excelbanter.com/excel-programming/329321-return-cell-co-ordinates.html)

Jonny

Return cell co-ordinates
 
Hi I haven't used vba for a while now and i've completely forgotten how to
return a cells range.

All i need is a simple msgbox that says "you are in cell A4"

Very easy i know, but the grey matter can't cope

TIA

JulieD

Return cell co-ordinates
 
Hi Jonny

sub sayhi()
msgbox "you are in " & activecell.address
end sub

--
Cheers
JulieD
check out www.hcts.net.au/tipsandtricks.htm
....well i'm working on it anyway
"Jonny" wrote in message
...
Hi I haven't used vba for a while now and i've completely forgotten how to
return a cells range.

All i need is a simple msgbox that says "you are in cell A4"

Very easy i know, but the grey matter can't cope

TIA




Robert Kedzie

Return cell co-ordinates
 
Hello Julie,

Try this:

sub sayhi()
dim st as string
st = selection.address
msgbox "you are in " & st
end sub

I just found this in a new book I bought the other day.

TucsonBob



Dave Peterson[_5_]

Return cell co-ordinates
 
Just to add to Julie's response:

You may want:

sub sayhi()
msgbox "you are in " & activecell.address(false,false)
end sub

This removes the $'s from $A$4.



JulieD wrote:

Hi Jonny

sub sayhi()
msgbox "you are in " & activecell.address
end sub

--
Cheers
JulieD
check out www.hcts.net.au/tipsandtricks.htm
...well i'm working on it anyway
"Jonny" wrote in message
...
Hi I haven't used vba for a while now and i've completely forgotten how to
return a cells range.

All i need is a simple msgbox that says "you are in cell A4"

Very easy i know, but the grey matter can't cope

TIA


--

Dave Peterson

JulieD

Return cell co-ordinates
 
Hi Dave

thanks for this, didn't know how to do it ..

--
Cheers
JulieD
check out www.hcts.net.au/tipsandtricks.htm
....well i'm working on it anyway
"Dave Peterson" wrote in message
...
Just to add to Julie's response:

You may want:

sub sayhi()
msgbox "you are in " & activecell.address(false,false)
end sub

This removes the $'s from $A$4.



JulieD wrote:

Hi Jonny

sub sayhi()
msgbox "you are in " & activecell.address
end sub

--
Cheers
JulieD
check out www.hcts.net.au/tipsandtricks.htm
...well i'm working on it anyway
"Jonny" wrote in message
...
Hi I haven't used vba for a while now and i've completely forgotten how
to
return a cells range.

All i need is a simple msgbox that says "you are in cell A4"

Very easy i know, but the grey matter can't cope

TIA


--

Dave Peterson





All times are GMT +1. The time now is 04:24 AM.

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