Monday, February 11, 2008

Sample Excel Macro

Sub Test()

Dim rng As Range
Dim counter As Integer
Dim LeftValue As String
Dim StrCell As String

Set rng = Range("A1:C8")
counter = 1
Dim Temp

For counter = 1 To rng.Rows.Count

Temp = rng.Cells(counter, 1).Value & " and " & rng.Cells(counter, 2).Value
rng.Cells(counter, 3).Value = Temp
'StrCell = rng.Cells(counter, 2).Value
'MsgBox (Temp)
Next

End Sub

No comments: