Move Copied row to next Blank Row in another Worksheet

Gerry Hunt

New Member
Joined
Apr 10, 2021
Messages
11
Office Version
  1. 365
Platform
  1. Windows
Can somebody please help with the following problem. I need a macro/VBA to do the following:

(Use relative references) ??

Macro record


1. Copy cells in columns A to M cells in selected row in current worksheet.

2. Switch to next worksheet entitled “CASH” (note both worksheets have identical column formats)

3. Paste the copied row values in the next blank row in the CASH worksheet (this is the area in which I am having the problem)

4. Move to the pasted row - column K cell.

5. Cut the value in the row/column K cell and paste in the row column J cell.

6. Move to the row/column I cell and insert text “ From Bank”.

7. Move to the row Column H cell – delete the existing value and replace with “1.3”

Stop macro recording
 
Try this:

VBA Code:
Sub MoveCopiedRow()
  Dim i As Long
  With Sheets("CASH")
    i = .UsedRange.Rows(.UsedRange.Rows.Count).Row + 1
    .Range("A" & i & ":M" & i).Value = Range("A" & ActiveCell.Row & ":M" & ActiveCell.Row).Value
    .Range("J" & i).Value = .Range("K" & i).Value
    .Range("K" & i).Value = ""
    .Range("I" & i).Value = "From Bank"
    .Range("H" & i).Value = "1.3"
  End With
End Sub
 
Upvote 0

Excel Facts

Test for Multiple Conditions in IF?
Use AND(test, test, test, test) or OR(test, test, test, ...) as the logical_test argument of IF.

Forum statistics

Threads
1,214,899
Messages
6,122,155
Members
449,068
Latest member
shiz11713

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