next open row

joacro

Board Regular
Joined
Jun 24, 2010
Messages
158
Hi there,

Someone assist me in this code, where the entries of txtboxes go into the next availible open row:

Private Sub CmdAdd_Click()

LR = Cells(Rows.Count, "A").End(xlUp).Row + 1
Range("A" & LR) = txtPrin
Range("A" & LR + 1) = txtSpouse
Range("A" & LR + 2) = txtCh1
Range("A" & LR + 3) = txtCh2
Range("A" & LR + 4) = txtCh3
Range("A" & LR + 5) = txtCh4
Range("A" & LR + 6) = txtCh5
Range("A" & LR + 7) = txtCh6
End Sub

It is working perfectly, however I need txtTotal to go into the same Row as txtPrin but in Colum "I"

Hope someone can assist me in this

Kind regards

Joacro
 
Try like this

[co9de]
Range("I" & Rows.Count).End(xlUp).Offset(1).Value = Val(txtTotal)
[/code]
 
Upvote 0

Excel Facts

How to calculate loan payments in Excel?
Use the PMT function: =PMT(5%/12,60,-25000) is for a $25,000 loan, 5% annual interest, 60 month loan.
Range("I" & Rows.Count).End(xlUp).Offset(1).Value = Format(Val(txtTotal),"0.332£
[/code]
 
Upvote 0

Forum statistics

Threads
1,224,548
Messages
6,179,451
Members
452,915
Latest member
hannnahheileen

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