简体   繁体   中英

Pasting data from PowerPoint text boxes into Excel

I have a PowerPoint that I need to copy the numbers in text boxes to a specific excel file. I have decided to use a macro on the PowerPoint because the file will be shared with multiple users and I want to compile each file's data into a spreadsheet. My code works fine so far, but only copies to a specific row and thus overwrites the existing data. I am having trouble with the code for finding the next empty row. What I tried so far only seems to work when going from excel to excel.

rw = Range("A" & Rows.Count).End(xlUp).Offset(1).Select

I am a novice at best when it comes to VBA. Please help.

While xlsWB.Worksheets(1).Range("A" & row) <> ""
row = row + 1
Wend

This will find the next empty row and store the row number within the integer row . xlsWB is an Object which stores CreateObject("Excel.Application").Workbooks.Open("File Path")

Then, use the following syntax to fill in your cells.

xlsWB.Worksheets(1).Range("A" & row) = ""

Also, you can use a For loop to automate it.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM