Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
DiscussionsAccessExcelInfoPathOutlookPowerPointPublisherWord
DirectoryUser Groups
Related Topics
Outlook ExpressInternet ExplorerWindowsMS Server ProductsMore Topics ...

MS Office Forum / Word / Programming / February 2006

Tip: Looking for answers? Try searching our database.

Populating an excel list from an Array

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
thiaga - 27 Feb 2006 16:29 GMT
I have an array(Variant) of values.
I would like to show them as a list in the excel worksheet.
How do i do this? I am a newbie!!
Helmut Weber - 27 Feb 2006 16:42 GMT
Hi Thiaga,

like this, and there is a lot more to it.

It isn't half of the truth!

read this first.
http://word.mvps.org/faqs/interdev/ControlXLFromWord.htm

Sub Macro21()
Dim l As Long
' create an array and fill it
Dim sArr(1 To 10) As String
For l = 1 To 10
  sArr(l) = Format(l, "00")
  Debug.Print sArr(l)
Next
Dim oExl As Excel.Application
Set oExl = New Excel.Application
oExl.Visible = True
' create a new workbook
With oExl.Workbooks.Add
  ' fill excel-cells with the values from your array
  For l = 1 To 10
     oExl.ActiveWorkbook.ActiveSheet.Cells(l, 1).Value = sArr(l)
  Next
  End With
End Sub

Signature

Greetings from Bavaria, Germany

Helmut Weber, MVP WordVBA

Win XP, Office 2003
"red.sys" & Chr$(64) & "t-online.de"

>I have an array(Variant) of values.
>I would like to show them as a list in the excel worksheet.
>How do i do this? I am a newbie!!

Rate this thread:






 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.