last row lookup failure

wwbwb

Well-known Member
Joined
Oct 20, 2003
Messages
513
this code I adapted from an earlier project. It's supposed to take the textboxes and put them in the first available row within the given range. But it keeps putting the information always in the same spot, overwriting anything that is there. It also ignores the fact that there is already rows that are filled. Any ideas? :rolleyes:
Code:
Dim LastRow As Object

          Set LastRow = Sheets("Details").Range("a83").End(xlUp)

          LastRow.Offset(1, 1).Value = TextBox1.Text
          LastRow.Offset(1, 0).Value = TextBox2.Text
          LastRow.Offset(1, 2).Value = TextBox3.Text
                    
          response = MsgBox("Do you want to enter more?", _
              vbYesNo)

          If response = vbYes Then
              TextBox1.Text = ""
              TextBox2.Text = ""
              TextBox3.Text = ""
                          
              TextBox1.SetFocus

          Else
              Unload Me
          End If
End Sub
 

Excel Facts

What did Pito Salas invent?
Pito Salas, working for Lotus, popularized what would become to be pivot tables. It was released as Lotus Improv in 1989.
TommyGun said:
Probably need to adjust "A83" to "A65536".

Row 83 has totals in it. If I put A65536 in, it works just fine, except all the data goes under row 83, negating the totals row. The area I have set for this information is row 50 to 82 with the totals in 83.
 
Upvote 0
are the values continuing to fill down in column A? That's where your code is looking to find the last used cell.
 
Upvote 0
north19701 said:
are the values continuing to fill down in column A? That's where your code is looking to find the last used cell.

Why yes... silly me! :LOL: Thanks. I think I will go hide in my little hole now. :oops:
 
Upvote 0

Forum statistics

Threads
1,207,094
Messages
6,076,549
Members
446,212
Latest member
KJAYPAL200

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top