LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 41
Default Trying To Append String Variable To Another String Variable


I have several if statements listed below, that correspond to the string
values in the "B" column. If the .Cells(iRow, "B").Text= "BASE" then
prodcode = "0003408909". Please help me add the prodcode string to the
myStr string listed below.

Please help me modify the code listed below to add the prodcode to the myStr
string listed below.

Thanks so much for the help.

Dim prodcode As String
Dim myStr As String
Dim wks As Worksheet


With wks
FirstRow = 1
FirstCol = 3
For iRow = FirstRow + 1 To 6
If .Cells(iRow, "B").Text = "BASE" Then
prodcode = "0003408909"
ElseIf .Cells(iRow, "B").Text = "TEAM" Then
prodcode = "0003498909"
ElseIf .Cells(iRow, "B").Text = "COURSE" Then
prodcode = "0003407909"
End If
For iCol = FirstCol + 1 To 64
myStr = .Cells(1, iCol).Text & "," _
& prodcode & "," _
& .Cells(iRow, iCol).Text
Print #1, myStr
Next iCol
Next iRow
End With
 
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
Variable string$ Ferdy New Users to Excel 3 November 26th 08 08:45 PM
Variable in string DevinC Excel Discussion (Misc queries) 5 January 26th 06 08:59 PM
setting a range variable equal to the value of a string variable Pilgrim Excel Programming 2 July 1st 04 11:32 PM
How do I convert an integer variable to a string variable? dumbass Excel Programming 2 May 21st 04 07:34 PM
Join string with variable name to get variable value Dianne Excel Programming 6 February 12th 04 04:24 AM


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