need macro

FrankSit

New Member
Joined
Nov 13, 2024
Messages
6
Office Version
  1. 2021
Platform
  1. Windows
  2. Mobile
Hello, Anybody can help me on how to make a macro to modify the lay out of my worksheet as shown in Sheet1, to be like the one shown in "To be" sheet. This is the format of report from a database that can be
copied to clip board in excel. Each person has multifield downward, and each group has a blank row cell in excel. In "to be", I want the period total to the line of the name. So that I can use vlookup each person's donation for 2023 compared with 2024

Thank you for any help

Frank
 

Attachments

  • Sheet1.jpg
    Sheet1.jpg
    103.4 KB · Views: 8
  • Tobe sheet.jpg
    Tobe sheet.jpg
    9.6 KB · Views: 8
Thank you very much Fuji, it works for me. My question is if the number of row is more than 50000, I just change the a50000?.

Thank you,

Frank
Yes correct.
Or you could also reference whole column, if you like (bit slower though)
Code:
        x = Filter(.[transpose(if(a:a<>"",row(a:a)))], False, 0)
        y = Filter(.[transpose(if(f:f<>"",row(f:f)))], False, 0)
 
Upvote 0

Excel Facts

Copy a format multiple times
Select a formatted range. Double-click the Format Painter (left side of Home tab). You can paste formatting multiple times. Esc to stop
Perhaps this would be faster...
Code:
Sub test()
    Sheets("to be").Columns("a:b").Clear
    With Sheets("sheet1")
        On Error Resume Next
        .Columns("a").SpecialCells(2).Copy Sheets("to be").[a1]
        .Columns("f").SpecialCells(2).Copy Sheets("to be").[b1]
        On Error GoTo 0
    End With
End Sub
 
Upvote 0

Forum statistics

Threads
1,223,723
Messages
6,174,122
Members
452,545
Latest member
boybenqn

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