473,387 Members | 1,573 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,387 software developers and data experts.

Address of Top Left Cell

18
Is there a quick way to determine the address of the top left cell of the current selection in an excell spreadsheet?

Expand|Select|Wrap|Line Numbers
  1. Selection.Address
yields the address of the entire selection, which is not what I want. I could of course extract the required information from there (discard everything after the ":"), but that seems a roundabout way.

Thanks

EB
Jun 25 '08 #1
2 1146
kadghar
1,295 Expert 1GB
Hi,

selection.row
selection.column

might be of help, e.g.

Expand|Select|Wrap|Line Numbers
  1. Sub MyAdress()
  2. MsgBox "Column: " & Selection.Column & Chr(13) & "Row: " & Selection.Row
  3. End Sub
HTH

(btw, this is my 1000th post here ^.^)
Jun 25 '08 #2
EByker
18
Thanks! I used your idea to create the following function:

Expand|Select|Wrap|Line Numbers
  1. Function TopLeftAddress()
  2.     TopLeftAddress = Range("A1").Offset(Selection.Row - 1, Selection.Column - 1).Address
  3. End Function
  4.  
  5. Sub Test()
  6.     MsgBox TopLeftAddress
  7. End Sub
EB
Jun 26 '08 #3

Sign in to post your reply or Sign up for a free account.

Similar topics

6
by: TJ | last post by:
I've got a calendar that is based on the concept of lots of blocks that are spans with float:left. I would like to be able to have a detail section on the right side of the screen, so that when...
2
by: ted | last post by:
Hi, Was wondering if it's possible to find the left position of a table cell if the cell is created dynamically. I have a table with a single cell. When a button is clicked, I'd like to add...
4
by: UJ | last post by:
I have a long list of items that the user will be able to select from. When they select an item, I'd like to have more detailed information appear on the right side of the screen. I've already got...
1
by: Greg | last post by:
When a datagrids RightToLeft property is set to true, as expected, it right aligns the caption text, and reverses the order of the columns. When typing text into a cell, the text is right aligned....
2
by: rudicheow | last post by:
SHORT VERSION ============= I have a bunch of identical fixed-size single-celled tables that rest against each other horizontally thanks to "float:left". These tables are dynamically generated...
2
by: =?Utf-8?B?UmljaA==?= | last post by:
Hello, When clicking on the top left corner of a datagridview - then entire contents of the datagridview is selected. When clicking on that cell - what event gets triggered/fired? I tried...
0
by: =?Utf-8?B?UmljaA==?= | last post by:
In a datagridview, the first column header cell is columnHeader(0), which is immediately to the right of the Top Left Corner Select All cell. And the first RowHeader cell is RowHeaderCell(0) which...
7
by: doreply | last post by:
I've got code: struct Cell{ list<int> vertices; bool discrete; Cell* nextCell; } struct SearchNode{ Cell* partition;
17
by: Ben Bacarisse | last post by:
candide <toto@free.frwrites: These two statements are very different. The first one is just wrong and I am pretty sure you did not mean to suggest that. There is no object in C that is the...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.