ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   MsgBox cell address (https://www.excelbanter.com/excel-programming/431798-msgbox-cell-address.html)

A & S

MsgBox cell address
 
Hi I am currently trying to inform the user if a certain cell needed
for the macro is empty, the code that I have works fine but it always
shows the cell address as $B$4 instead of B4. Is there a way that I
can get it to show the cell address without the dollar signs.

Here is my code.

If newSht = "" Then
MsgBox "There must be a fixture name present in cell " &
ActiveCell.Address
Exit Sub
End If


Thanks

Sam Wilson

MsgBox cell address
 
activecell.address(false,false)

"A & S" wrote:

Hi I am currently trying to inform the user if a certain cell needed
for the macro is empty, the code that I have works fine but it always
shows the cell address as $B$4 instead of B4. Is there a way that I
can get it to show the cell address without the dollar signs.

Here is my code.

If newSht = "" Then
MsgBox "There must be a fixture name present in cell " &
ActiveCell.Address
Exit Sub
End If


Thanks


Lars-Åke Aspelin[_2_]

MsgBox cell address
 
On Thu, 30 Jul 2009 06:55:14 -0700 (PDT), "A & S"
wrote:

Hi I am currently trying to inform the user if a certain cell needed
for the macro is empty, the code that I have works fine but it always
shows the cell address as $B$4 instead of B4. Is there a way that I
can get it to show the cell address without the dollar signs.

Here is my code.

If newSht = "" Then
MsgBox "There must be a fixture name present in cell " &
ActiveCell.Address
Exit Sub
End If


Thanks



Try this modification:

MsgBox "There must be a fixture name present in cell " &
ActiveCell.Address(False, False)

Hope this helps / Lars-Åke

The Code Cage Team[_144_]

MsgBox cell address
 

Use this line:

Code:
--------------------
MsgBox "There must be a fixture name present in cell " & Replace(ActiveCell.Address, "$", "")
--------------------


A & S;435894 Wrote:
Hi I am currently trying to inform the user if a certain cell needed
for the macro is empty, the code that I have works fine but it always
shows the cell address as $B$4 instead of B4. Is there a way that I
can get it to show the cell address without the dollar signs.

Here is my code.

If newSht = "" Then
MsgBox "There must be a fixture name present in cell " &
ActiveCell.Address
Exit Sub
End If


Thanks



--
The Code Cage Team

Regards,
The Code Cage Team
'The Code Cage' (http://www.thecodecage.com)
------------------------------------------------------------------------
The Code Cage Team's Profile: http://www.thecodecage.com/forumz/member.php?userid=2
View this thread: http://www.thecodecage.com/forumz/sh...d.php?t=121001



All times are GMT +1. The time now is 09:46 AM.

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