VBA array code help

karthikthandapani

New Member
Joined
Apr 30, 2014
Messages
14
Code:
[COLOR=#008000][FONT=Consolas]'List of PPT Slides to Paste to
[/FONT][/COLOR][COLOR=#141414][FONT=Consolas] MySlideArray = Array(2, 3, 4, 5, 6)[/FONT][/COLOR]

[COLOR=#008000][FONT=Consolas]'List of Excel Ranges to Copy from
[/FONT][/COLOR][COLOR=#141414][FONT=Consolas]   MyRangeArray = Array(Sheet1.Range([/FONT][/COLOR][COLOR=#800000][FONT=Consolas]"A1:C10"[/FONT][/COLOR][COLOR=#141414][FONT=Consolas]), Sheet4.Range([/FONT][/COLOR][COLOR=#800000][FONT=Consolas]"A1:C10"[/FONT][/COLOR][COLOR=#141414][FONT=Consolas]), _[/FONT][/COLOR]
[COLOR=#141414][FONT=Consolas]      Sheet3.Range([/FONT][/COLOR][COLOR=#800000][FONT=Consolas]"A1:C10"[/FONT][/COLOR][COLOR=#141414][FONT=Consolas]), Sheet2.Range([/FONT][/COLOR][COLOR=#800000][FONT=Consolas]"A1:C10"[/FONT][/COLOR][COLOR=#141414][FONT=Consolas]), Sheet5.Range([/FONT][/COLOR][COLOR=#800000][FONT=Consolas]"A1:C10"[/FONT][/COLOR][COLOR=#141414][FONT=Consolas]))[/FONT][/COLOR]

With the above snippet, I need that to be modified below;

a) SlideArray - Modify that to fit n number of slides depends upon the requirement
b) MyRangeArray - Modify that to read & export ranges by the home tab. Looping style.

Code:
[/FONT][/COLOR][COLOR=#141414][FONT=Verdana][I]With myPresentation.PageSetup[/I][/FONT][/COLOR]
[COLOR=#141414][FONT=Verdana][I]shp.Left = (.SlideWidth \ 2) - (shp.Width \ 2)[/I][/FONT][/COLOR]
[COLOR=#141414][FONT=Verdana][I]shp.Top = (.SlideHeight \ 2) - (shp.Height \ 2)[/I][/FONT][/COLOR]
[COLOR=#141414][FONT=Verdana][I]End With[/I][/FONT][/COLOR][COLOR=#141414][FONT=Verdana]

c) SlideSetup - Respective to the range, make it to cover full slide (leave space to title)

Any help would be appreciated!
 

Excel Facts

What does custom number format of ;;; mean?
Three semi-colons will hide the value in the cell. Although most people use white font instead.

Forum statistics

Threads
1,215,746
Messages
6,126,651
Members
449,326
Latest member
asp123

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