Help - Find value, copy range and move cells to different columns

mompy76

New Member
Joined
Mar 20, 2015
Messages
7
Hi

I have a spreadsheet with approx 1000 lines of data which needs to be formatted. The lines number varies each week. I need to amend my macro so that it can capture/move the necessary data to the correct columns regardless of the number of rows. Column H contains subtotal headings (ie Total Gross) and column N contains the total $.

Column HColumn N
Total Gross123.00
Total Deductions456
Total Tax Including Extra Tax789.00
Total Employee's Super1011
Total Net Pay1,213.00
Total Employer's Super1,314.00
Total Salary Sacrifice1,415.00
Total Fringe Benefits0

<colgroup><col><col><col></colgroup><tbody>
</tbody>

I need the macro to be able to find the word "Total" in Column H, select the data Hxx:Nxx (ie 8 rows of total data), move Column H contents to Column G, and move Column N contents to Column I.

I would greatly appreciate all assistance with this.

Cheers
Mompy76
 
Last edited:

Excel Facts

Format cells as time
Select range and press Ctrl+Shift+2 to format cells as time. (Shift 2 is the @ sign).
Hi,
You have indicted you want to amend your macro, but you haven't supplied the code.
 
Upvote 0
Hi,
You have indicted you want to amend your macro, but you haven't supplied the code.

The code I have doesn't work at as it should, and deletes required content, as the cell row range I used changes each week. This was only noticed in the week following the creation of this macro when totals were out of balance on the linked spreadsheets.

This is what I have now:-

Selection.Find(What:="total", After:=ActiveCell, LookIn:=xlFormulas, _
LookAt:=xlPart, SearchOrder:=xlByRows, SearchDirection:=xlNext, _
MatchCase:=False, SearchFormat:=False).Activate
Range("H637:H700").Select
Selection.Cut Destination:=Range("G637:G700")
Range("N637:N700").Select
Selection.Cut Destination:=Range("I637:I700")
 
Upvote 0

Forum statistics

Threads
1,214,639
Messages
6,120,679
Members
448,977
Latest member
dbonilla0331

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