Microsoft Office Forums

Go Back   Microsoft Office Forums > >

 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
  #4  
Old 06-22-2022, 04:04 PM
Guessed's Avatar
Guessed Guessed is offline Simplest way to get row and column number? Windows 10 Simplest way to get row and column number? Office 2016
Expert
 
Join Date: Mar 2010
Location: Canberra/Melbourne Australia
Posts: 4,176
Guessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant future
Default

If you use the selection object it isn't too complex.
Code:
Sub GetUp()
  Dim aCell As Cell, aRng As Range
  Set aRng = Selection.Range
  Selection.Range.Cells(1).Select
  Selection.MoveUp
  If Selection.Range.Cells.Count = 1 Then
    Debug.Print Selection.Range.Cells(1).Range.Text
  Else
    Debug.Print "No cells immediately above selection"
  End If
  aRng.Select  'restore selection
End Sub
__________________
Andrew Lockton
Chrysalis Design, Melbourne Australia
Reply With Quote
 



Similar Threads
Thread Thread Starter Forum Replies Last Post
Simplest way to get row and column number? Count number of Ms between Hs in a column Marcia Excel 6 05-12-2020 06:21 PM
Want a quotient using a constant to show up in column c each time a number is added to column b fibbermcghee Excel 2 12-09-2014 05:48 PM
Simplest way to get row and column number? Formatting numbers in number column MS baby Project 1 06-03-2014 02:43 PM
Simplest way to get row and column number? What's The Best & Simplest Software Program To Backing Up Outlook 2010 highbids Outlook 1 08-23-2010 04:10 PM
Simplest way to get row and column number? Last Number in a Column paulrm906 Excel 1 12-05-2008 07:51 PM

Other Forums: Access Forums

All times are GMT -7. The time now is 10:06 PM.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2025, vBulletin Solutions Inc.
Search Engine Optimisation provided by DragonByte SEO (Lite) - vBulletin Mods & Addons Copyright © 2025 DragonByte Technologies Ltd.
MSOfficeForums.com is not affiliated with Microsoft