looking for some solutions? You are welcome.

SOLVED: VBA copy paste repeat until

Zura Pachoshvili:

Heey everyone. I want to copy paste values from one w.b to another and save it by name of the value. go to the sheet "BA" ,refresh pivot and copy first value. find all results true for copied value, copy all and paste it to another w.b. "AMEX W8 BA.xlsx" save as by name of the value copied from first w.b / sheet "BA" repeat until the value at first w.b / sheet "BA" / column "A" is empty I hope somebody can help me THX

Sub BA()

Dim x As Integer

    Sheets("BA").Select
    ActiveSheet.PivotTables("tabella pivot1").PivotCache.Refresh

For x = 2 To 15

Sheets("DB").Select
ActiveSheet.Range("$A$1:$R$1000").AutoFilter field:=18, Criteria1:=Sheets("BA").Cells(x, 1).Value
Columns("A:AX").Select
Selection.Copy

Workbooks.Open ("C:\Users\Zurab_Pachoshvili\Desktop\MCRS Recording\AMEX W8 BA.xlsx")

ActiveSheet.Range("A1").PasteSpecial PASTE:=xlPasteValues

Filename = "C:\Users\Zurab_Pachoshvili\Desktop" & Range("R2").Value & ".xlsx"
ActiveWorkbook.SaveAs Filename:=Filename, FileFormat:=xlNorma

    ActiveWindow.Close

Next

End Sub



Posted in S.E.F
via StackOverflow & StackExchange Atomic Web Robots
Share:

No comments:

Recent