Reorder/copy Data form big database into existing power point table template.

streetshark

New Member
Joined
May 2, 2022
Messages
1
Office Version
  1. 365
Platform
  1. Windows
Hello,

I have a big database with over 500 rows of objects and over 44 columns. The purpose is to select some of the objects(most of the time 7-10 objects/rows) and copy data of the 12 needed columns(12) to the existing powerpoint table for comparison. I would like to create a macro to speed up the process and dont need to copy every column by hand.
Step for Step
1. select objects(rows) /mark cell with an x (i have a code to scan the column for x)
2. press macro button
3. the data of the selected objects/rows should be copied/ reordered into an existing power point table.

I am new to VBA and i would appreciate any help.

this is my code so far to reorder the table in excel but i dont know how copy jsut the columns i need.
Dim ws1 As Worksheet, ws2 As Worksheet
Dim Myarray As Variant
Dim lastRow As Integer, LastColumn As Integer
Dim StartCells As Range


'set the data/worksheets(where is it from)
Set ws1 = ThisWorkbook.Sheets("Sheet1")
Google
Set ws2 = ThisWorkbook.Sheets("Sheet2")
Set StartCell = ws1.Range("A1")

lastRow = ws1.Cells(ws1.Rows.Count, StartCell.Column).End(xlUp).Row 'last row code
LastColumn = ws1.Cells(StartCell.Row, ws1.Columns.Count).End(xlToLeft).Column



Myarray = ws1.Range(StartCell, ws1.Cells(lastRow, LastColumn)).Value2 ' define the array
Myarray = WorksheetFunction.Transpose(Myarray)
ws2.Range("a1", ws2.Cells(LastColumn, lastRow)).Value = Myarray
 

Excel Facts

What do {} around a formula in the formula bar mean?
{Formula} means the formula was entered using Ctrl+Shift+Enter signifying an old-style array formula.

Forum statistics

Threads
1,224,827
Messages
6,181,199
Members
453,022
Latest member
RobertV1609

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top