Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3
Default How MsgBox can show address?

Hi
For each c in worksheets("sheet1").Rows("3:3").Cells
if c.value = 50 then
....
MsgBox c.address
(I need this "c" address. When I use ActiveCell.Offset(5), to paste the
value, the result is 30 rows, then 35 rows ... I want to see what address
the program is referring to. When comparison is being done (c.value = 50)
how to get this cell's address and how to put it for others including
MsgBox. Please help
Milind


  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 414
Default How MsgBox can show address?

When you loop through the cells in a range in this manner the activecell
does not change (unless you have explicitly activate each cell - which
you probably don't want to do). Select cell A1 then run this as an
example (you should have at least one cell in row 3 with a value of 50).

Sub Test()
Dim c As Range
For Each c In Rows(3).Cells
If c.Value = 50 Then
MsgBox "Activecell is " & ActiveCell.Address & Chr(10) _
& "Address of c is " & c.Address
End If
Next c
End Sub

Hope this helps
Rowan


Milind wrote:
Hi
For each c in worksheets("sheet1").Rows("3:3").Cells
if c.value = 50 then
...
MsgBox c.address
(I need this "c" address. When I use ActiveCell.Offset(5), to paste the
value, the result is 30 rows, then 35 rows ... I want to see what address
the program is referring to. When comparison is being done (c.value = 50)
how to get this cell's address and how to put it for others including
MsgBox. Please help
Milind


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
Returning a cell address in a msgbox, by selection via inputbox Ty FARAZ QURESHI Excel Discussion (Misc queries) 3 April 8th 09 12:57 PM
Show a message but not in MsgBox RobN[_2_] Excel Discussion (Misc queries) 2 May 30th 08 11:58 PM
Return Address of Blank Cells in MsgBox Sandy Excel Programming 4 August 25th 05 02:06 PM
MsgBox - Don't Show Again exceller Excel Programming 4 August 19th 04 11:23 PM
Show msgbox only when.... Tod Excel Programming 3 July 29th 03 06:21 PM


All times are GMT +1. The time now is 11:12 AM.

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"