Home IN EXCEL VBA i want to loop the above process for my next neets which name is same in source and destination excel 1 sheet have anoter 8 sheets?
Reply: 0

IN EXCEL VBA i want to loop the above process for my next neets which name is same in source and destination excel 1 sheet have anoter 8 sheets?

Vaishali Dhanawade
1#
Vaishali Dhanawade Published in 2018-01-11 07:16:05Z
Sub ABC()
    Dim wkb As Workbook
    Dim sht As Worksheet
    Dim fNameAndPath As Variant
    Dim MTS As Workbook

'this is my souce file

    fNameAndPath = Application.GetOpenFilename(FileFilter:="Excel Files (*.XLSX), *.XLSX", Title:="Select File To Be Opened")
    If fNameAndPath = False Then Exit Sub
    Workbooks.Open Filename:=fNameAndPath
    fNameAndPath = MTS.Name
    Sheets("ATA").Select
        Range("B4").Select
        Range(Selection, Selection.End(xlToRight)).Select
        Range("B4:AS4").Select
        Range(Selection, Selection.End(xlDown)).Select
        Selection.Copy

'this is my destination file

        Windows("filename").Activate
        Sheets("ATA").Select
        Range("B4").Select
        Range(Selection, Selection.End(xlToRight)).Select
        Range("B4:AS4").Select
        Range(Selection, Selection.End(xlDown)).Select
        Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
            :=False, Transpose:=False
        Windows("fNameAndPath").Activate
       ActiveWorkbook.Save

' want to give above process to another sheets which name same to both

file?

You need to login account before you can post.

About| Privacy statement| Terms of Service| Advertising| Contact us| Help| Sitemap|
Processed in 0.307897 second(s) , Gzip On .

© 2016 Powered by mzan.com design MATCHINFO