ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   multi dim array? (https://www.excelbanter.com/excel-programming/364948-multi-dim-array.html)

Buffyslay

multi dim array?
 
hi all

i have a chunk of data

I need to loop through the current range and then fill up the Multi(?)
dim'd array with the values.

i had got to -

For Each i In arrCC
For lRow = 2 To lRowCount ' ems number
For lCol = 1 To 18
arrCC(i) = ActiveCell.Value
ActiveCell.Offset(0, 1).Select
Next lCol
ActiveCell.Offset(1, -18).Select
Next lRow
Next

and then realised that i need to get more than one value type in - any
help greatly apreciated.
empNo Employee Number
empName Employee Name
MonthSal Monthly Base Salary
RetRate Retention Rate
Bonus Bonus
MonthShift Monthly Shift
Mobile Mobile Phone
AcqCost Acquistion Cost
StMonth Start Month
EndMonth End Month
AprIcn April monthly Increase £
NewMonthSal New Monthly Base Salary
MonthBonus Monthly Bonus / Retention
MonthPension Monthly Pension
MonthOtime Monthly Overtime
PHI PHI & Medical
Sports Sports & Social
MonthNI Monthly NI


Dave Peterson

multi dim array?
 
You can pick up all the values in a range with one command:

dim arrCC as variant
dim lRowCount as long

lrowcount = 7 'set it somehow

arrcc = activesheet.range("A2:R" & lrowcount).value

But I'm not sure where the activecell is. You may have to change that address.

And I'm not sure what the second question is.

Buffyslay wrote:

hi all

i have a chunk of data

I need to loop through the current range and then fill up the Multi(?)
dim'd array with the values.

i had got to -

For Each i In arrCC
For lRow = 2 To lRowCount ' ems number
For lCol = 1 To 18
arrCC(i) = ActiveCell.Value
ActiveCell.Offset(0, 1).Select
Next lCol
ActiveCell.Offset(1, -18).Select
Next lRow
Next

and then realised that i need to get more than one value type in - any
help greatly apreciated.
empNo Employee Number
empName Employee Name
MonthSal Monthly Base Salary
RetRate Retention Rate
Bonus Bonus
MonthShift Monthly Shift
Mobile Mobile Phone
AcqCost Acquistion Cost
StMonth Start Month
EndMonth End Month
AprIcn April monthly Increase £
NewMonthSal New Monthly Base Salary
MonthBonus Monthly Bonus / Retention
MonthPension Monthly Pension
MonthOtime Monthly Overtime
PHI PHI & Medical
Sports Sports & Social
MonthNI Monthly NI


--

Dave Peterson


All times are GMT +1. The time now is 01:45 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com