• Hi All

    Please note that at the Chandoo.org Forums there is Zero Tolerance to Spam

    Post Spam and you Will Be Deleted as a User

    Hui...

  • When starting a new post, to receive a quicker and more targeted answer, Please include a sample file in the initial post.

macro code to copy , go to special functions and sum on another sheet

RAM72

Member
Hi

Have a sheet with data in which in which there are blanks and need to delete headers .

Task copy and create a new sheet and apply macro to merge all a single database as per attached file . There will be original sheet aand new sheet called MASTER.

However there will be other sheets but load file as sample

Recorded macro but but need help to adjust to last data row and auto sum last column

Used autofilter and go to special functions but due high data manipulation I looking a macro to save time

Code:
Sub del_buyer_blanl_columntest()
'
' del_buyer_blanl_columnA Macro
'

'
    Range("I1").Select
    Range(Selection, Selection.End(xlDown)).Select
    Range(Selection, Selection.End(xlToLeft)).Select
    ActiveCell.Activate
    Selection.AutoFilter
    ActiveSheet.Range("$A$1:$I$435").AutoFilter Field:=1, Criteria1:= _
        "=Buyer's Reference", Operator:=xlOr, Criteria2:="="
    Range("A3:A423").Select
    Selection.SpecialCells(xlCellTypeBlanks).Select
    Selection.EntireRow.Delete
    Range("A3:I411").Select
    Selection.SpecialCells(xlCellTypeVisible).Select
    Selection.ClearContents
    ActiveSheet.Range("$A$1:$I$423").AutoFilter Field:=1, Criteria1:="="
    ActiveSheet.Range("$A$1:$I$423").AutoFilter Field:=1
    Range("A1:A422").Select
    Selection.SpecialCells(xlCellTypeBlanks).Select
    Selection.EntireRow.Delete
 
End Sub
 

Attachments

  • MASTER WORKINGS TEST.xlsm
    71.3 KB · Views: 2

Obviously, if you do not want a gas factory procedure
(a slower and less efficient code),
it's better you think about where you start and where you finish
before to post a question in any forum,
better to be able to create a crystal clear thread
as it would be very easy in your previous thread to directly
ask for this result !

« Step by step » is a waste of time for both side …
So I stop here until you explain the final result.
 
Back
Top