Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Viewing Multi dimensional array

Hi

This is my first post in here and I have just recently started learnin
programming Excel macros. I've been trying to do a tool that sends emai
to the person that is selected from the worksheet with the information
which is located on the selected row. This I can done but when I a
trying to send email that contains information from more than one row
have to raise my hands up.

I can use arrays to set the selected range etc. (A1:A3) to the arra
and even in to a multidimensional array but how can I insert thi
variable into a email message body? If I break down th
multidimensional array (3x3) to three one dimensionals and then joi
them the formatting goes wrong.

Example:

Invoice Date GrossAmount
111 01.01. 100
222 02.02. 200

I create arrays Invoice(2), date(2), grossamount(2).

If I know set them to my emailbody with join the view will change t
this:

111
222
01.01.
02.02.
100
200

which is not what I wanted.

If I use multi dimensional arrays I have no idea how to print all th
"cells" in to the screen or message. Etc. Msgbox (multiArray) won'
work.

I could set up certain limits, how many cells user can choose, bu
that's not reasonable since user have to be able select as many a
she/he want's to. The number of columns is however always three.

Any ideas how can I do this?

This is my code so far (the email part is not included):
Sub Mailia()

Calculate
Dim laskut() As String
Dim summat() As String
Dim paivat() As String

Dim i As Integer
Dim rivit As Integer

Dim laskulista As Variant
r = Chr(13)

rivit = Selection.Rows.Count

ReDim laskut(rivit)
ReDim paivat(rivit)
ReDim summat(rivit)

If ActiveCell = "" Then
MsgBox ("Valitse laskut, joita karhutaan")
Exit Sub
End If

Set Laskualue = Selection
Laskualue.Cells(1).Select

For i = 1 To rivit
laskut(i) = ActiveCell
summat(i) = ActiveCell(, 2)
paivat(i) = ActiveCell(, 3)
ActiveCell.Offset(1, 0).Select
Next i

laskulista = laskut
a = Join(laskut, r)
b = Join(summat, r)
c = Join(paivat, r)
...

Best Regards
Tim

--
Message posted from http://www.ExcelForum.com

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
newbie question on multi-dimensional array sammus New Users to Excel 2 April 3rd 06 03:11 AM
Viewing Multi dimensional array Codea Excel Programming 1 August 5th 04 01:30 PM
Enumerating a multi-dimensional array Robert Stober Excel Programming 7 September 13th 03 12:28 PM
Problem with Multi-Dimensional Array Kirk[_2_] Excel Programming 2 August 26th 03 03:31 PM
How to declare Multi-dimensional dynamic array? Terence Excel Programming 1 August 11th 03 04:55 AM


All times are GMT +1. The time now is 03:46 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"