Get_Cell_Number
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 |
Get_Cell_Number
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 |
Get_Cell_Number
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). |
Get_Cell_Number
|
Get_Cell_Number
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() |
Get_Cell_Number
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() |
Get_Cell_Number
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 |
All times are GMT +1. The time now is 03:41 PM. |
Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
ExcelBanter.com