Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
How can I do this the other way round?
Sub Get_Cell_Number() MsgBox Cells(1).Address End Sub e.g. Cells(1,1) 'result = 1 |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Hi,
Am Fri, 3 Apr 2015 08:21:13 -0700 (PDT) schrieb : Sub Get_Cell_Number() MsgBox Cells(1).Address End Sub e.g. Cells(1,1) 'result = 1 what do you want as result? Row number, column number, column character or cell address? Regards Claus B. -- Vista Ultimate / Windows7 Office 2007 Ultimate / 2010 Professional |
#3
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
On Saturday, April 4, 2015 at 2:21:17 AM UTC+11, wrote:
How can I do this the other way round? Sub Get_Cell_Number() MsgBox Cells(1).Address End Sub e.g. Cells(1,1) 'result = 1 The Cell number as in Cells(1,1) is the same as Cells(1) Cells(1,2) is the same as Cells(2). |
#4
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]() |
#5
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
On Saturday, April 4, 2015 at 2:21:17 AM UTC+11, wrote:
How can I do this the other way round? Sub Get_Cell_Number() MsgBox Cells(1).Address End Sub e.g. Cells(1,1) 'result = 1 Hi Claus, That gives the column number. I want the opposite of this: MsgBox Cells(16385).Address() |
#6
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
hi,
Sub Macro1() n = 32768 rws = Columns.Count If n < rws Then rw = 1 clm = n Else If n Mod rws = 0 Then rw = Int(n / rws) clm = Columns.Count Else: rw = Int(n / rws) + 1 clm = n Mod rws End If End If MsgBox Cells(rw, clm).Address() End Sub isabelle Le 2015-04-05 17:07, a écrit : I want the opposite of this: MsgBox Cells(16385).Address() |
#7
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
for a better understanding of this macro, i changed "rws" to "clms"
Sub Macro1() n = 32769 ' xl2007 + -- 16384(XFD1) 32768(XFD2) clms = Columns.Count If n < clms Then rw = 1 clm = n Else If n Mod clms = 0 Then rw = Int(n / clms) clm = Columns.Count Else: rw = Int(n / clms) + 1 clm = n Mod clms End If End If MsgBox Cells(rw, clm).Address() End Sub isabelle |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|