How can I copy visible cells only and paste using vbscript?

Hello everyone!
I have just filtered data and want to copy visible cells from column 1 and paste same data row column 8. How can i do that using vbscript ?

Hi @robo_007

  1. Use Invoke VBA activity from the Activities panel onto the design canvas.
  2. In the properties of the “Invoke VBA” activity, set the following values:
  • CodeFilePath: Leave it blank to write the VBScript code directly in the “Code” property.
  • Code: Enter the VBScript code to perform the copy and paste operations.

Try to use this below VBScript code

Dim excelApp, workbook, worksheet, range
Set excelApp = CreateObject("Excel.Application")
excelApp.Visible = False
Set workbook = excelApp.Workbooks.Open("C:\path\to\your\file.xlsx")
Set worksheet = workbook.Worksheets(1)
worksheet.UsedRange.SpecialCells(12).Copy
excelApp.Worksheets.Add
excelApp.ActiveSheet.Paste
workbook.Save
workbook.Close
excelApp.Quit
Set range = Nothing
Set worksheet = Nothing
Set workbook = Nothing
Set excelApp = Nothing

Regards
Gokul

This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.