Public Schedule Face-to-Face & Online Instructor-Led Training - View dates & book

STL - Formerly Best Training Solutions Through Learning
TrustPilot
Excellent
Request Callback We will call you back
0207 987 3777 Call for assistance
Your Basket Basket is empty
arrays

ResolvedVersion 2016

Diane has attended:
Excel VBA Introduction course
Excel VBA Intermediate course
Excel VBA Advanced course

Arrays

I have used this command successfully to move the contents of an array to a sheet (all rows, only 3 columns). I want to then repeat this, opening two other workbooks and copying them into an array. but for these subsequent workbooks I don't want the first row in the array, as it is a title row and I already have that from my first workbook. How do I modify this line to get all the array except the first row please?

Range(sStartCell).Resize(UBound(NamesArray, 1), 3) = NamesArray

RE: Arrays

Hi Diane,

I hope that you are fine.


If you are using CurrentRegion to feed your array you should use an Offset to avoid getting the header row in your array.


NamesArray=Sheets(1).Currentregion.Offset(1,0)


You can also empty your array by using a double For Next loop.

For iRow=2 to Ubound(NamesArray,1)
For iCol=1 to 3

"Your start cell"=NamesArra(iRow,iCol)
Next iCol
Next iRow



You will also need to navigate "your start cell" by using the counters from the two loops. You can use Cells(iRow, iCol), but you will need to amend this so it fit to your needs.

I hope this makes sense.

Kind regards

Jens Bonde
Microsoft Office Specialist Trainer

Tel: 0207 987 3777
STL - https://www.stl-training.co.uk
98%+ recommend us

London's leader with UK wide delivery in Microsoft Office training and management training to global brands, FTSE 100, SME's and the public sector

RE: Arrays

Hi Jens

Thanks very much. This is very helpful and clear.

Diane

Excel tip:

Display pictures on Chart Data Point

Replacing a single chart data point bar with a picture.
Step 1: Left click on a bar. Then, wait, and do a second single click on the bar. This will select just one data point.

Step 2: Right click on the bar and select Format Data Point.

Step 3: On the fill effects tab, choose a picture. Browse for a picture for that bar. Indicate if you want it to be stretched or stacked. Repeat for each bar.

View all Excel hints and tips

Connect with us:

0207 987 3777

Call for assistance

Request Callback

We will call you back

Server loaded in 0.08 secs.