Microsoft Office Forums

Go Back   Microsoft Office Forums > >

Reply
 
Thread Tools Display Modes
  #1  
Old 08-19-2014, 02:24 AM
Jockster's Avatar
Jockster Jockster is offline find last used cell in row in a table Windows 7 64bit find last used cell in row in a table Office 2010 64bit
Novice
find last used cell in row in a table
 
Join Date: Aug 2014
Location: UK
Posts: 2
Jockster is on a distinguished road
Default find last used cell in row in a table

Sounds straightforward but it is giving me endless grief.
Using a userform and VBA, I need to figure out how to add data after the last cell which has data in it on a specific row.
So, for example, on row 10 of the attached, the last used cell in in "C" however, the last used cell in row 11 is "E"


Using the usual methods of finding the last column all seem to result in the last column of the table (in this case "F") and not the last cell in a row.

How can I get around this puzzle?
Attached Files
File Type: xlsx Table Sample.xlsx (10.0 KB, 8 views)
Reply With Quote
  #2  
Old 08-19-2014, 10:27 PM
excelledsoftware excelledsoftware is offline find last used cell in row in a table Windows 7 64bit find last used cell in row in a table Office 2003
IT Specialist
 
Join Date: Jan 2012
Location: Utah
Posts: 455
excelledsoftware will become famous soon enough
Default

I found this trick a little bit ago and it has been amazing for finding the last row

Code:
FinalRow = Range("A50000").End(XlUp).Row + 2   'experiment what to add
'to make the last row you actually want get selected.
I tried this with your workbook and it appeared to work just fine but when you say the last row used you will need to change the number added on the end of the statement to get it to grab what you want. Also if your worksheet is longer than 50,000 rows just increase that amount in the range.

Let me know if that works

Thanks
Reply With Quote
  #3  
Old 08-20-2014, 01:08 AM
Jockster's Avatar
Jockster Jockster is offline find last used cell in row in a table Windows 7 64bit find last used cell in row in a table Office 2010 64bit
Novice
find last used cell in row in a table
 
Join Date: Aug 2014
Location: UK
Posts: 2
Jockster is on a distinguished road
Default

Thanks for replying.
This doesn't do what I was hoping for however, the following does so have managed to get around the issue:
Quote:
LastColumn = Cells.Find(What:="", After:=ActiveCell.Offset(, 13), LookIn:=xlValues, LookAt:=xlPart, SearchOrder:=xlByRows, SearchDirection:=xlNext, MatchCase:=False, SearchFormat:=False).Select
Activecell.Offset (,13) - Active cell is the lookup value found in col "A" and the Offset part moves the start of the search area 13 columns away from the active cell; What:="" is searching for the first blank cell after col 13.
Reply With Quote
Reply



Similar Threads
Thread Thread Starter Forum Replies Last Post
find last used cell in row in a table Table with text that flows from cell to cell hwrigley Word Tables 7 02-18-2014 02:59 AM
Find out whether a cell has been typed or calculated C J Squibb Excel 1 10-01-2013 11:41 AM
find last used cell in row in a table cell of one table to display in a second table HalinQuincy Word Tables 4 04-03-2011 04:11 PM
find last used cell in row in a table VBA find or name a Table smed Word VBA 1 01-17-2011 02:18 PM
Auto-populate an MS Word table cell with text from a diff cell? dreamrthts Word Tables 0 03-20-2009 01:49 PM

Other Forums: Access Forums

All times are GMT -7. The time now is 09:35 AM.


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