Simple question - Simple Solution - Last Row

erutherford

Active Member
Joined
Dec 19, 2016
Messages
342
object -defined error still occurs at the first textBox1 value

<code>
LastRow = Cells(Rows.Count, 1).End(xlUp).Offset(1)
Cells(LastRow, 1) = TextBox1.Value 'FN
Cells(LastRow, 2) = TextBox2.Value 'LN
Cells(LastRow, 3) = TextBox3.Value 'Add1
Cells(LastRow, 4) = TextBox4.Value 'Add2
Cells(LastRow, 5) = TextBox5.Value 'Add3
Cells(LastRow, 6) = TextBox6.Value 'City
Cells(LastRow, 7) = TextBox7.Value 'State
Cells(LastRow, 8) = TextBox8.Value 'Zip
Cells(LastRow, 9) = TextBox9.Value 'Country
Cells(LastRow, 10) = TextBox10.Value 'Email
Cells(LastRow, 11) = TextBox11.Value 'Ph1
Cells(LastRow, 12) = TextBox12.Value 'Ph2
Cells(LastRow, 13) = DTPicker1.Value 'Start Time
Cells(LastRow, 14) = DTPicker2.Value 'End Tme
Cells(LastRow, 15) = TextBox13.Value 'Notes
</code>

I also check to be sure Last Row was ID
Dim LastRow As Long
 

Some videos you may like

Excel Facts

Why are there 1,048,576 rows in Excel?
The Excel team increased the size of the grid in 2007. There are 2^20 rows and 2^14 columns for a total of 17 billion cells.

RoryA

MrExcel MVP, Moderator
Joined
May 2, 2008
Messages
34,688
Office Version
365, 2019, 2016, 2010
Platform
Windows, MacOS
You forgot the .Row:

Rich (BB code):
LastRow = Cells(Rows.Count, 1).End(xlUp).Offset(1).Row
 

erutherford

Active Member
Joined
Dec 19, 2016
Messages
342
Rory,
You were spot on, ".row" solved the issue. Just took a while to get back to the project. Thanks for sticking with me on this!

till next time.......
 

Forum statistics

Threads
1,089,544
Messages
5,408,867
Members
403,238
Latest member
George_Ong

This Week's Hot Topics

  • help please
    SORRY NOT ANY GOOD AT EXCEL SO HELP WOULD BE MUCH APPRECIATED this formula is in a sheet called ignore...
  • two formulas needed
    Hello, I'll try my best to explain this: First formula needed in Sheet1 cell A2: If Sheet1 cell B2 = Sheet2 cell B2 then return a 1. If not then...
  • Dynamic Counts
    Good afternoon, we are tidying up some data & the data seems to be growing quicker than we are tidying it up! What we confirm (by reviewing it...
  • Help Excel formula eliminate duplicate values and keep only 2 identical rows.
    as picture below column A has a duplicate value. but the values are not the same as the rule. sometimes 4 rows, sometimes 10 rows or 7 or 9...
  • Macro Compile Error Sub or Function not defined
    Hello, I am trying to run macros from a validation list, all macros have been created and run perfectly on there own but I'm getting a compile...
  • Last row combined with Current Region VBA
    I'm generally happy finding the last row of data through something like Lastrow = Cells(Rows.Count, "D").End(xlUp) but I don't always receive data...
Top