Find row and column of Selected cell
I need to get the Row and Column of a Selected Cell... The User selects the cell and the script needs to return to me the Row and Column.
Also how do you convert Column 1 to Range Column A? to use from Cells(5,1) To Range("A5") ?
Are you talking about working VB with excel ?
If so, for your first question I think you could use the ActiveCell property of a worksheet object. With ActiveCell property you can get the property Row and Col for the row and column selected, like ActiveCell.Row or ActiveCell.Col.
For your second question I'm not very sure how you want to handle it but you could use the ASCII code to do something like:
col = var + 65
where var would be the col in the form Cell(row,col), the you just can convert that number to character:
and then concatenate the col_str with the number of row like:
range = col_str & Trim(Str(row))
Trim(Str(row)) I know what Trim does.. it removes spaces.. What is Str from?
Is that a variable I have to find earlier? or is it a built in?
Try this out
Something with nmxnmx 's lead.
try the given code for the 2nd Question
Full functioning is with the attached excell file
Function getColName(colNumber As Integer) As String
If colNumber >= 1 And colNumber <= 26 Then
getColName = Chr(colNumber - 1 + 65)
getColName = getColName(colNumber \ 26) & getColName(colNumber - 26 * (colNumber \ 26))
By jrhaley123 in forum Java
Last Post: 09-28-2013, 10:48 PM
Last Post: 02-09-2006, 09:17 AM
By Dan Thibodeaux in forum .NET
Last Post: 04-23-2002, 11:23 AM
By Jan Vettenburg in forum Java
Last Post: 11-30-2001, 10:57 AM
By Victor in forum VB Classic
Last Post: 04-07-2000, 11:35 AM
-- Android Development Center
-- Cloud Development Project Center
-- HTML5 Development Center
-- Windows Mobile Development Center