ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   how do you add a row of data like in a database (https://www.excelbanter.com/excel-programming/300636-how-do-you-add-row-data-like-database.html)

mabz

how do you add a row of data like in a database
 
I am trying to add a row of data at the bottom of a named table using a
userform and VBA code.

I was unable to do this and it's driving me round the u bend!

PLEASE can any one help me before i go mad:(


---
Message posted from http://www.ExcelForum.com/


pikus

how do you add a row of data like in a database
 
nextRow = ActiveSheet.UsedRange.Row + _
ActiveSheet.UsedRange.Rows.Count
ActiveSheet.Cells(nextRow, 1).Value = NewColumn1Value
ActiveSheet.Cells(nextRow, 2).Value = NewColumn2Value

Does this answer your question? - Pikus


---
Message posted from http://www.ExcelForum.com/


mabz[_2_]

how do you add a row of data like in a database
 
THANKS FOR THE CODE

but how do i add data from a text box on a userform to the end of
table.

~AS in you type in data in a form that pops up(Userform1)
~You click a button(called Add record)
~New data is added to the end of the tabl

--
Message posted from http://www.ExcelForum.com


N E Body

how do you add a row of data like in a database
 
Hi

I am using

Sheets("Data").Select
Sheets("Data").Range("A65536").End(xlUp).Offset(1, 0).Range("A1").Activate

to locate the next empty row then

LogEntry.TextBox1.Text = ActiveCell.Offset(0, 1).Value
LogEntry.ComboBox1.Value = ActiveCell.Offset(0, 3).Value
LogEntry.ComboBox2.Value = ActiveCell.Offset(0, 4).Value
LogEntry.ComboBox3.Value = ActiveCell.Offset(0, 5).Value
LogEntry.ComboBox4.Value = ActiveCell.Offset(0, 6).Value
LogEntry.ComboBox5.Value = ActiveCell.Offset(0, 7).Value
LogEntry.ComboBox6.Value = ActiveCell.Offset(0, 8).Value
LogEntry.ComboBox7.Value = ActiveCell.Offset(0, 9).Value
LogEntry.TextBox3.Text = ActiveCell.Offset(0, 10).Value
LogEntry.TextBox4.Text = ActiveCell.Offset(0, 11).Value
LogEntry.TextBox5.Text = ActiveCell.Offset(0, 12).Value
LogEntry.TextBox7.Text = ActiveCell.Offset(0, 14).Value

where LogEntry is the name of the userform

HTH

Kenny

"mabz " wrote in message
...
THANKS FOR THE CODE

but how do i add data from a text box on a userform to the end of a
table.

~AS in you type in data in a form that pops up(Userform1)
~You click a button(called Add record)
~New data is added to the end of the table


---
Message posted from http://www.ExcelForum.com/




mabz[_3_]

how do you add a row of data like in a database
 
Thank you sooo much!!!!!!!!!!!!!!!!!!!

Now I can create colourful foems to impress every on

--
Message posted from http://www.ExcelForum.com



All times are GMT +1. The time now is 06:59 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
ExcelBanter.com