• 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.

Copy Visible cell only

Hi,

I have some issue regarding copy visible cell only. Can anyone help please?
Below is my full code.

KIM Chanthan
You have asked many time to
>>> use code - tags <<<


Code:
Sub Con_Each_File_to_Each_Tab()

Dim FolderPath As String
Dim Filename As String
Dim Sheet As Worksheet
Set Master = Workbooks("Consolidate - V2.xlsm")
FolderPath = ActiveWorkbook.Path & "\"
Filename = Dir(FolderPath & "*.xlsb*")

Do While Filename <> ""
    Application.ScreenUpdating = False
    Application.AskToUpdateLinks = False
    Application.DisplayAlerts = False
        Workbooks.Open Filename:=FolderPath & Filename, ReadOnly:=True
        Set BranchWB = ActiveWorkbook
        Name = Worksheets("Disbursement Plan").Range("E2").Value
        Worksheets("Disbursement Plan").Range("A1:AR43").Copy
        Master.Worksheets(Name).Activate
        Range("A1").PasteSpecial xlPasteValues
       
            n = Master.Worksheets("Plan by CO-KHR").Range("B2").CurrentRegion.Rows.Count + 1
           
                BranchWB.Activate
                Worksheets("Consol-KHR").Unprotect "password1"
                Worksheets("Consol-KHR").Range("B4:AJ115").Select
                Selection.SpecialCells(xlCellTypeVisible).Select
                Selection.Copy
                Master.Worksheets("Plan by CO-KHR").Activate
                Range("B" & n).PasteSpecial xlPasteValues
               
        Workbooks(Filename).Close Savechanges:=False
        Filename = Dir()
    Application.AskToUpdateLinks = True
    Application.DisplayAlerts = True
    Application.ScreenUpdating = True
Loop
End Sub
 
Last edited by a moderator:
Back
Top