Note that there are some explanatory texts on larger screens.

plurals
  1. POBatch pasting data into excel
    primarykey
    data
    text
    <p>I have a load of data which I need to process. I process it by pasting the raw data into a pre-made excel spreadsheet, trimming a few rows of zeros at the bottom of the processing (not pasted in) columns, and then running a macro to remove cells with 0 in them in column P.</p> <p>Each spreadsheet takes 6 sets of raw data, each in a separate worksheet. The zero-removing macro takes a while so I would like to do the pasting as a separate job if I can.</p> <p>I feel like this should be pretty simple but unfortunately I only have a very basic knowledge of code. My idea so far has been to try and use AutoHotKey to record a sequence to do it, but unfortunately it is clunky and hasn't worked so far because alt-tabbing is unreliable or some other issue. </p> <p><strong>I would like to make a code which switches between windows, copying the data from one excel (tab delimited .txt) file into the main .xlsm document.</strong></p> <p>I would manually save it and then open the next 6 datasets and a blank processing workbook.</p> <p>Thanks for your time x</p> <p>Edit: The datasets are always called a,a1,a2,b,b1,b2. They are always located in the same folder as the data processing spreadsheet. The data processing spreadsheet is always called [processor.xlsm]</p> <p>Edit2: This is where I am:</p> <pre><code>Sub ImportData1() 'Prevent windows asking about saving clipboard data Application.DisplayAlerts = False 'select dataset a Worksheets("SeqA Run1").Activate Workbooks.Open Filename:=ThisWorkbook.Path &amp; "\a.txt" ActiveSheet.Range("A4:I1000").Copy Windows("Surge Test Data Analysis Importer.xlsm").Activate Range("A7").Select ActiveSheet.Paste ''Close dataset Windows("a.txt").Activate ActiveWorkbook.Close 'Select dataset a1 Worksheets("SeqA Run2").Activate Workbooks.Open Filename:=ThisWorkbook.Path &amp; "\a1.txt" ActiveSheet.Range("A4:I1000").Copy Windows("Surge Test Data Analysis Importer.xlsm").Activate Range("A7").Select ActiveSheet.Paste ''Close dataset Windows("a1.txt").Activate ActiveWorkbook.Close '(repeat several times) 'Re-enable windows prompts about clipboards etc Application.DisplayAlerts = True End Sub </code></pre>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload