Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 59
Default Filling Array from Cells on Worksheet

Greetings,
I am using the Routing function on Excel and I would like to autofill the
routing recipients and route the workbook based on the people that are in a
range of cells.

The Cells that auto fill based on fomula's are A1:A6....some cells may be
blank. I am just unfamiliar with arrays, but here is where I am so far with
the code:

ActiveWorkbook.HasRoutingSlip = True
With ActiveWorkbook.RoutingSlip
.Recipients = Array(????)
End With
ActiveWorkbook.Route

I think I will need to use a FOR statement, but need a little help. Thank
you very much,
Mike


  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 252
Default Filling Array from Cells on Worksheet

Try this:

dim vArr as Variant
dim Rng as Range

set Rng = .Range("A1:A6")
vArr = Rng.Value

ActiveWorkbook.HasRoutingSlip = True
With ActiveWorkbook.RoutingSlip
.Recipients = vArr
End With
ActiveWorkbook.Route

"Mike R." wrote:

Greetings,
I am using the Routing function on Excel and I would like to autofill the
routing recipients and route the workbook based on the people that are in a
range of cells.

The Cells that auto fill based on fomula's are A1:A6....some cells may be
blank. I am just unfamiliar with arrays, but here is where I am so far with
the code:

ActiveWorkbook.HasRoutingSlip = True
With ActiveWorkbook.RoutingSlip
.Recipients = Array(????)
End With
ActiveWorkbook.Route

I think I will need to use a FOR statement, but need a little help. Thank
you very much,
Mike


  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 111
Default Filling Array from Cells on Worksheet

Hi,
Try this...
Sub trythis()
Dim myArr() As String, rngRecip As Range, rngCell As Range, intInc As
Integer

Set rngRecip = ThisWorkbook.Sheets(1).Range("$A$1:$A$6")

For Each rngCell In rngRecip
With rngCell
If .Value < "" Then
ReDim Preserve myArr(intInc)
Let myArr(intInc) = CStr(.Value)
End If
End With
Next rngCell

With ThisWorkbook
.HasRoutingSlip = True
.RoutingSlip.Recipients = myArr
.Route
End With

Set rngRecip = Nothing
End Sub

  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 59
Default Filling Array from Cells on Worksheet

these both worked perfect....thank you!

"OJ" wrote:

Hi,
Try this...
Sub trythis()
Dim myArr() As String, rngRecip As Range, rngCell As Range, intInc As
Integer

Set rngRecip = ThisWorkbook.Sheets(1).Range("$A$1:$A$6")

For Each rngCell In rngRecip
With rngCell
If .Value < "" Then
ReDim Preserve myArr(intInc)
Let myArr(intInc) = CStr(.Value)
End If
End With
Next rngCell

With ThisWorkbook
.HasRoutingSlip = True
.RoutingSlip.Recipients = myArr
.Route
End With

Set rngRecip = Nothing
End Sub


Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Drag-filling a formula Array Jacob C. Excel Discussion (Misc queries) 5 April 9th 09 09:20 PM
Filling a few cells based on the info from another worksheet. Bruce[_2_] Excel Worksheet Functions 5 May 23rd 07 02:32 AM
help with filling in an array formula Caitlin Excel Discussion (Misc queries) 5 November 7th 06 08:12 PM
Filling a List Box in Excel from an Array Martin Excel Discussion (Misc queries) 4 October 18th 05 11:50 AM
Filling an array with data Dongle Excel Worksheet Functions 2 May 18th 05 06:06 PM


All times are GMT +1. The time now is 05:34 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"