Excel Ninjas: Loop Copy/Paste Category Types at Row Level

Dirock

New Member
Joined
Sep 1, 2016
Messages
2
Hello,

I am trying to create a macro that does the following:

  1. Loop down sheet and copy the Description (Column E) Ex: Copy "Cash in Bank" [Note: the empty cells at the category description level (Beg and End)]
  2. Paste the description in (Column L) next to each transaction Ex: Paste "Cash in Bank" in cells L3 and L4
  3. Continue loop until end of sheet, which can be 1000+ transactions and with multiple categories


PropertyProperty NameDatePeriodDescriptionControlReferenceDebitCreditBalanceRemarksCategory
1120-2450Cash in Bank100= Beginning Balance =
101st101 Street3/1/2019Mar 2019Bank of Excel5646556465405105Loan#123(Cell L3)
wall4123 Wall St3/19/2019Mar 2019Bank of Excel879413812010115Inv# 456(Cell L4)
Net Change = 20015115= Ending Balance =
1115-0000Utility Deposits20.00= Beginning Balance =
104th104th street3/22/2019mar 2019The Gas Company5768411354510525CheckScan #2001
50ths50th street3/8/2019mar 2019The Gas Company48413215684120530454654
Net Change = 501030= Ending Balance =

<tbody>
</tbody>

Each category has a different amount of transactions each month. Any help would be great with this code. Thank you in advance! :)
 

Excel Facts

Difference between two dates
Secret function! Use =DATEDIF(A2,B2,"Y")&" years"&=DATEDIF(A2,B2,"YM")&" months"&=DATEDIF(A2,B2,"MD")&" days"
Hi & welcome to MrExcel.
How about
Code:
Sub Dirock()
   Dim Rng As Range
   For Each Rng In Range("F2", Range("F" & Rows.Count).End(xlUp)).SpecialCells(xlConstants).Areas
      Rng.Offset(, 6).Value = Rng.Offset(-1, -1).Resize(1, 1).Value
   Next Rng
End Sub
 
Upvote 0
Hi & welcome to MrExcel.
How about
Code:
Sub Dirock()
   Dim Rng As Range
   For Each Rng In Range("F2", Range("F" & Rows.Count).End(xlUp)).SpecialCells(xlConstants).Areas
      Rng.Offset(, 6).Value = Rng.Offset(-1, -1).Resize(1, 1).Value
   Next Rng
End Sub

Thank you so much! This code is beautiful and so much simpler than what I was trying to put together! :LOL::)
 
Upvote 0
You're welcome & thanks for the feedback
 
Upvote 0

Forum statistics

Threads
1,213,551
Messages
6,114,266
Members
448,558
Latest member
aivin

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