Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
if you set an array to a range of cells, how to you fill it with only cells
that have text or a value in them? arr2 = Worksheets("emp").Range("L2:L" & lastrow).Value i only want cells that have text in them to populate the array -- Gary |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
The array takes the dimensions of the range, if it didn't then you could not
reference the array back the cell. To load only populated cells you will need to read them into the array using a loop, and you may also want to record the cell reference into another dimension of the array storing where the value resides on the sheet. -- Cheers Nigel "GKeramidas" wrote in message ... if you set an array to a range of cells, how to you fill it with only cells that have text or a value in them? arr2 = Worksheets("emp").Range("L2:L" & lastrow).Value i only want cells that have text in them to populate the array -- Gary |
#3
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Hi GKeramidas,
Try this one : Sub ArrayIn() For Each rng In Worksheets("emp").Range("L2:L7") Arr2 = Arr2 & "," & rng.Value Next rng Arr2 = Mid(Arr2, 2) Debug.Print Arr2 end sub Rgds, Halim GKeramidas menuliskan: if you set an array to a range of cells, how to you fill it with only cells that have text or a value in them? arr2 = Worksheets("emp").Range("L2:L" & lastrow).Value i only want cells that have text in them to populate the array -- Gary |
#4
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
got it thanks
-- Gary wrote in message oups.com... Hi GKeramidas, Try this one : Sub ArrayIn() For Each rng In Worksheets("emp").Range("L2:L7") Arr2 = Arr2 & "," & rng.Value Next rng Arr2 = Mid(Arr2, 2) Debug.Print Arr2 end sub Rgds, Halim GKeramidas menuliskan: if you set an array to a range of cells, how to you fill it with only cells that have text or a value in them? arr2 = Worksheets("emp").Range("L2:L" & lastrow).Value i only want cells that have text in them to populate the array -- Gary |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Array: Counting multiple values within array | Excel Worksheet Functions | |||
fill array | Excel Programming | |||
fill down array to last available row | Excel Worksheet Functions | |||
Fill values into a listbox matching selected values from a combobox | Excel Programming | |||
Fill an Array with String values | Excel Programming |