2 min readfrom Microsoft Excel | Help & Support with your Formula, Macro, and VBA problems | A Reddit Community

VBA - Trouble pasting data from source

Hello, my dear wizards. I seem to be dealing with an issue that confounds me.

I am working on a tool that takes raw data from 2 separate sources, and throws it all in one file, with several tabs to give a quick overview of the relevant data to check together (both the originals go into column DSomething, I don't need all that data, but I do need to verify data in column B against columns AC, BF, and DS, for example).

I have succesfully done all the hard parts, what with getting the information I need into the proper place once the source data is pasted. I'm struggling with the part that, to me, should be the easy bit.

I have two specific buttons, let's call them Button1 and Button2. These run the data imports and construction of the rest of the pages for me. Because of some subtle differences and checks in the source material I figured running through two specially built routines would be more practical. The way I built it up there should also not be any issues in which data it is you import first. The idea is you CTRL+A > CTRL+C the source doc, and then press the button to run the macro, with the source data on the clipboard.

However, I'm running into a bit of an issue. When I run either the PressButton1 or PressButton2 macros, everything is fine. When I then try to run the other one, it fails. Abandon, recopy the data, press the button again, and it runs.

No matter where I start, the second run through fails. Both macros are completely capable of running successfully, though.

Sub PressButton1() ' *** Imports Raw Data Sheets("Button 1 Data").Select Range("A1").Select ActiveSheet.Paste ' ***Rest of Code*** 

The error I'm getting is at the ActiveSheet.Paste point. It gives a "1004: paste method of worksheet class failed".

Any idea where this is coming from, and how to fix it? Thanks!

submitted by /u/simply_not_edible
[link] [comments]

Want to read more?

Check out the full article on the original site

View original article

Tagged with

#Excel alternatives for data analysis
#generative AI for data analysis
#big data management in spreadsheets
#conversational data analysis
#real-time data collaboration
#intelligent data visualization
#data visualization tools
#enterprise data management
#big data performance
#data analysis tools
#data cleaning solutions
#financial modeling with spreadsheets
#natural language processing for spreadsheets
#no-code spreadsheet solutions
#rows.com
#Excel compatibility
#google sheets
#Excel alternatives
#VBA
#macros