ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   In macros, an instruction that will return the position of the Active Cell (https://www.excelbanter.com/excel-programming/351064-macros-instruction-will-return-position-active-cell.html)

aca[_4_]

In macros, an instruction that will return the position of the Active Cell
 

In a macro, how can I make it show the position of the Active Cel
(Column/Line).
Or how can I set that position as a Condition; e.g. “If ActiveCell i
B7 Then….”
Or “If ActiveCell belongs to Column G Then….”
Thanks in advance for any help.
AC

--
ac
-----------------------------------------------------------------------
aca's Profile: http://www.msusenet.com/member.php?userid=385
View this thread: http://www.msusenet.com/t-187369019


Leith Ross[_483_]

In macros, an instruction that will return the position of the Active Cell
 

Hello Aca,

The following examples should help answer your questions. Reversing the
equations will set the ActiveCell address, column, or row to that value.

The Address: Addx = ActiveCell.Address
The Column: Col = ActiveCell.Column
The Row: Row = ActiveCell.Row

Sincerely,
Leith Ross


--
Leith Ross
------------------------------------------------------------------------
Leith Ross's Profile: http://www.excelforum.com/member.php...o&userid=18465
View this thread: http://www.excelforum.com/showthread...hreadid=503527


Ken Johnson

In macros, an instruction that will return the position of the Active Cell
 
Hi aca
how can I make it show the position of the Active Cell<

MsgBox ActiveCell.Address
MsgBox ActiveCell.Column
MsgBox ActiveCell.Row
how can I set that position as a Condition; e.g. "If ActiveCell is

B7 Then...." <
If ActiveCell.Address = $B$7 Then ...(be careful with this one, must
have the $'s)
If ActiveCell belongs to Column G Then...<

If ActiveCell.Column = 7 Then...

Ken Johnson



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

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