Microsoft Office Forums

Go Back   Microsoft Office Forums > >

 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
  #2  
Old 10-23-2021, 06:28 PM
minerva.goree minerva.goree is offline VBA: Attempting to loop through all resources, apply a filter and paste the results into Excel Windows 10 VBA: Attempting to loop through all resources, apply a filter and paste the results into Excel Office 2019
Novice
 
Join Date: Oct 2021
Posts: 6
minerva.goree is on a distinguished road
Default

Hi Miles,

I did a quick test and this worked for me. I do have a newer version of Office, so I don't know if it will work for you.

You can change the range to wherever you need it. I didn't specify the size of my table, just a simple paste to start at the cell I chose for my range:

Code:
Sub test()

    'Select all data and copy
    Application.SelectAll
    Application.EditCopy


    ' Excel - setup
    Set xlApp = GetObject(, "Excel.application")
    
    If xlApp Is Nothing Then
        Set xlApp = CreateObject("Excel.Application")
    End If
    
    ' Excel - create a new workbook
    xlApp.Visible = True
    xlApp.Workbooks.Add
    
    ' Excel - create column headings
    Set xlRange = xlApp.Range("A1")
    
    xlRange.PasteSpecial Paste:=xlPasteValues

End Sub
Minerva
Home | Mad Schedules With Minerva Goree
YouTube: mad schedules - YouTube
Reply With Quote
 



Similar Threads
Thread Thread Starter Forum Replies Last Post
VBA: Attempting to loop through all resources, apply a filter and paste the results into Excel Copy Paste Special Loop to End of Col A ChrisOK Excel Programming 8 01-19-2020 10:20 PM
Filter not returning all relevant results hnhorner Excel 3 07-12-2015 05:33 PM
VBA: Attempting to loop through all resources, apply a filter and paste the results into Excel Loop through files and Copy Table Row and Paste into Different Document spiderman1369 Word VBA 2 10-15-2014 08:30 AM
VBA: Attempting to loop through all resources, apply a filter and paste the results into Excel Formatting- Apply changes to highlighted text results in same change to other text sential Word 6 01-10-2014 03:22 PM
Apply filter with VBA bobsawyer7 Outlook 0 03-12-2012 04:02 AM

Other Forums: Access Forums

All times are GMT -7. The time now is 06:12 AM.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2025, vBulletin Solutions Inc.
Search Engine Optimisation provided by DragonByte SEO (Lite) - vBulletin Mods & Addons Copyright © 2025 DragonByte Technologies Ltd.
MSOfficeForums.com is not affiliated with Microsoft