LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5
Default New to VBA - Setting Excel Columns to Strings

On Mar 26, 10:32 am, "Bernie Deitrick" <deitbe @ consumer dot org
wrote:
Dustin,

You can treat the range of cells as an array:

Dim myArr As Range
Dim myCell As Range
Dim exApp As Object

Set myArr = exApp.Range("B:B").SpecialCells(xlCellTypeConstant s)

For Each myCell In myArr
'Do something with each value, like
MsgBox myCell.Value
Next myCell

HTH,
Bernie
MS Excel MVP

"Dustin" wrote in message

oups.com...

Sub Macro()


'This Section Opens up the document<<<<<<<<<<<<<'
'################################################# ########'
Dim wdApp As Word.Application, wdDoc As Word.Document
On Error Resume Next
Set wdApp = GetObject(, "Word.Application")
If Err.Number < 0 Then 'Word isn't already running
Set wdApp = CreateObject("Word.Application")
End If
On Error GoTo 0
Set wdDoc = wdApp.Documents.Open("Doc.doc")
wdApp.Visible = True
wdApp.Activate
'################################################# ########'


'This Section Finds the Table<<<<<<<<<<<<<'
'################################################# ########'


wdApp.Selection.Find.ClearFormatting
With wdApp.Selection.Find
.Text = "what i'm searching for"
.Replacement.Text = ""
.Forward = True
.Wrap = wdFindContinue
.Format = False
.MatchCase = False
.MatchWholeWord = False
.MatchWildcards = False
.MatchSoundsLike = False
.MatchAllWordForms = False
End With
wdApp.Selection.Find.Execute
wdApp.Selection.MoveUp Unit:=wdLine, Count:=1
wdApp.Selection.MoveDown Unit:=wdLine, Count:=172,
Extend:=wdExtend
wdApp.Selection.MoveUp Unit:=wdLine, Count:=2, Extend:=wdExtend
wdApp.Selection.Copy
wdApp.Documents.Close
wdApp.Visible = False
'################################################# ########'


'This Selection Starts Excel<<<<<<<<<<<<<'
'################################################# ########'
Dim exApp As Excel.Application
On Error Resume Next
Set exApp = GetObject(, "Excel.Application")
If Err.Number < 0 Then 'Excel isn't already running
Set exApp = CreateObject("Excel.Application")
End If
On Error GoTo 0
'################################################# ########'


'This Selection Creates a new Sheet<<<<<<<<<<<<<'
'################################################# ########'


Dim wSht As Worksheet
Dim shtName As String
shtName = ("WordStuff")
For Each wSht In Worksheets
If wSht.Name = shtName Then
MsgBox "Sheet already exists...Make necessary " & _
"corrections and try again."
Exit Sub
End If
Next wSht
Sheets.Add.Name = shtName
'################################################# ########'


'This Selection Pastes the table from Word<<<<<<<<<<<<<'
'################################################# ########'
exApp.ActiveSheet.Paste
exApp.ActiveCell.Activate
exApp.Columns("B").Select


'################################################# ########'


End Sub


From this point how would I store the strings in the column B to an

array?


Thanks


Thanks for the quick response. I got the information in arrays
properly as needed.

Thank Yall Very Much

 
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
Setting up Excel to search by columns instead of by rows, by defau Keith Howard Setting up and Configuration of Excel 2 April 27th 08 07:50 PM
matching columns using text strings! via135 via OfficeKB.com Excel Worksheet Functions 2 November 14th 06 04:00 AM
How to check matching strings in 3 columns Demitre Excel Discussion (Misc queries) 2 December 17th 05 11:40 PM
Separating strings into different columns from one cell Melanie O Excel Worksheet Functions 2 January 27th 05 04:20 PM
Delete Columns based on Strings scott Excel Programming 2 January 18th 05 12:43 AM


All times are GMT +1. The time now is 07:15 PM.

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

About Us

"It's about Microsoft Excel"