inseting a set of strings

jamtay317

Well-known Member
Joined
Mar 6, 2013
Messages
769
I'm tring to insert a set of strings, and for some reason its not going to the next open row, its just inserting them over the last record. Can someone please look at the code and tell me where I'm wrong?

Code:
Private Sub Insert_Payment_Click()Dim Payment As String, PaymentAddress As String


    Worksheets("Payments").Select
        Payment = Range("E4")
        PaymentAddress = Range("B4")
        
    Worksheets("RentalDates").Select
    Worksheets("RentalDates").Range("I1").Select
    If Worksheets("RentalDates").Range("I1").Offset("1,0") <> "" Then
    Worksheets("RentalDates").Range("I1").End(xlDown).Select
    End If
    ActiveCell.Offset(1, 0).Select
    ActiveCell = Payment
    ActiveCell.Offset(0, -2).Select
    ActiveCell = PaymentAddress
    ActiveCell.Offset(0, 1).Select
    ActiveCell = Date
    Worksheets("Payments").Select
    Range("B4").Select
    ActiveCell.ClearContents
    ActiveCell.Offset(0, 3).Select
    ActiveCell.ClearContents
    
    
End Sub
 

Some videos you may like

Excel Facts

Bring active cell back into view
Start at A1 and select to A9999 while writing a formula, you can't see A1 anymore. Press Ctrl+Backspace to bring active cell into view.

jamtay317

Well-known Member
Joined
Mar 6, 2013
Messages
769
thanks anyways everyone, I found it the offset in the if has "1,0" instead of 1,0
 

Watch MrExcel Video

Forum statistics

Threads
1,123,329
Messages
5,600,997
Members
414,419
Latest member
JRDunya

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
Top