ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   How to return column number (https://www.excelbanter.com/excel-programming/400647-how-return-column-number.html)

moonhk

How to return column number
 
Hi All

How to return column number ? I want return 4 not D.
Below is my coding,
MsgBox ActiveCell.SpecialCells(xlLastCell).Address '~~ $D$6
RowCnt = InStr(2, ActiveCell.SpecialCells(xlLastCell).Address,
"$", 0)
MsgBox Left(ActiveCell.SpecialCells(xlLastCell).Address, RowCnt -
1) '~~ $D

Moonhk


Stefi

How to return column number
 
MsgBox ActiveCell.SpecialCells(xlLastCell).Column

Regards,
Stefi

€˛moonhk€¯ ezt Ć*rta:

Hi All

How to return column number ? I want return 4 not D.
Below is my coding,
MsgBox ActiveCell.SpecialCells(xlLastCell).Address '~~ $D$6
RowCnt = InStr(2, ActiveCell.SpecialCells(xlLastCell).Address,
"$", 0)
MsgBox Left(ActiveCell.SpecialCells(xlLastCell).Address, RowCnt -
1) '~~ $D

Moonhk



DomThePom

How to return column number
 
The row and column properties of the range object will return what you need.
ie if the active cell is in D2 then:
Activecell.coumn = 4
Activecell.row = 2

"moonhk" wrote:

Hi All

How to return column number ? I want return 4 not D.
Below is my coding,
MsgBox ActiveCell.SpecialCells(xlLastCell).Address '~~ $D$6
RowCnt = InStr(2, ActiveCell.SpecialCells(xlLastCell).Address,
"$", 0)
MsgBox Left(ActiveCell.SpecialCells(xlLastCell).Address, RowCnt -
1) '~~ $D

Moonhk



moonhk

How to return column number
 
On 11 6 , 7 33 , DomThePom
wrote:
The row and column properties of the range object will return what you need.
ie if the active cell is in D2 then:
Activecell.coumn = 4
Activecell.row = 2



"moonhk" wrote:
Hi All


How to return column number ? I want return 4 not D.
Below is my coding,
MsgBox ActiveCell.SpecialCells(xlLastCell).Address '~~ $D$6
RowCnt = InStr(2, ActiveCell.SpecialCells(xlLastCell).Address,
"$", 0)
MsgBox Left(ActiveCell.SpecialCells(xlLastCell).Address, RowCnt -
1) '~~ $D


Moonhk- -


- -


Thank a lot


moonhk

How to return column number
 
On 11 6 , 7 33 , DomThePom
wrote:
The row and column properties of the range object will return what you need.
ie if the active cell is in D2 then:
Activecell.coumn = 4
Activecell.row = 2



"moonhk" wrote:
Hi All


How to return column number ? I want return 4 not D.
Below is my coding,
MsgBox ActiveCell.SpecialCells(xlLastCell).Address '~~ $D$6
RowCnt = InStr(2, ActiveCell.SpecialCells(xlLastCell).Address,
"$", 0)
MsgBox Left(ActiveCell.SpecialCells(xlLastCell).Address, RowCnt -
1) '~~ $D


Moonhk- -


- -


Thank a lot



All times are GMT +1. The time now is 06:54 AM.

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