VBA - Macro for making banking file quicker to work with

JRAMZ88

New Member
Joined
Jun 7, 2017
Messages
28
Office Version
  1. 365
Platform
  1. Windows
Hi everyone - First off, I want to say thank you all for being such great resources - I have received a lot of help from some of you on here!
I'm hoping someone can help me with this particular request.

I have a file with daily banking activity that I download every day.
The report has tons of "garbage" that I don't necessarily need. So I'm hoping someone can assist me with this VBA code to help me streamline and be more efficient in the workplace.

Here's what I need the macro to do:

-select entire worksheet and unmerge all cells (file comes merged from the bank)
-then, I need to delete columns A, B, C, F, G, J and K (these are all garbage fields)
-then, once the above mentioned columns are gone, I need to insert 2 new columns in between columns A and B.
  • the first column, which will now be B will contain the number 40
  • the second new column will now be C will contain a concatenate formula to concatenate columns A and C starting in cell C7.
-lastly, once all of this is complete, I need to filter column E by Card Type in alphabetical order... the headings are listed on row 6.


I understand this is a lot to ask for, and it makes it hard to visualize - I have included a sample screenshot with dummy data to show what the end result would be that I'm looking for.




Any help or guidance would be much appreciated!!
 
Hey I am really sorry on the late reply was working ona big project at work and barely had time to log onto here...

Glad everything is working fine so far :)

To get the sorting at the end just add this to the end of the code

Code:
    Range("E1").Select
    ActiveSheet.Sort.SortFields.Clear
    ActiveSheet.Sort.SortFields.Add Key:=Range("E2:E" & LastRow) _
        , SortOn:=xlSortOnValues, Order:=xlAscending, DataOption:=xlSortNormal
    With ActiveSheet.Sort
        .SetRange Range("E1:E" & LastRow)
        .Header = xlYes
        .MatchCase = False
        .Orientation = xlTopToBottom
        .SortMethod = xlPinYin
        .Apply
    End With

this should be place in between the last Range line and the End Sub line
 
Upvote 0

Excel Facts

Format cells as date
Select range and press Ctrl+Shift+3 to format cells as date. (Shift 3 is the # sign which sort of looks like a small calendar).

Forum statistics

Threads
1,223,911
Messages
6,175,325
Members
452,635
Latest member
laura12345

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