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: 57
Default Add Text to Textbox value by looping through a data range.

Hello

I Currently have the code at the end of message.

it loops each cell in the c column in a work sheet.
takes the current textbox value and stores in a variable.
It then concatenates this to a sentance from with other variables on the
same row.
saves back to the text box and then starts again through all the iterations.
The Problem I am having is that the outputed text in the text box only has
the values from the first itteration or loop.

Could someone please explain what i'm doing wrong.

Thanks in Advance.

Code -
Dim name As String
Dim Datee As String
Dim start As String
Dim length As String
Dim newtext As String
Dim currenttext As String
ActiveWorkbook.save
finalrow = Worksheets("Adherancebycriteria").Range("c65536"). End(xlUp).Row
For Each code In
Worksheets("Adherancebycriteria").Range("c8").Resi ze(finalrow - 7, 1)
name = code.Offset(, -2).Value
Datee = code.Offset(, 3).Value
start = code.Offset(, 4).Value
length = code.Offset(, 6).Value
currenttext = Worksheets("Time Utilisation").TextBoxes("Text Box 2").Text
newtext = currenttext & "" & name & " was in " & code.Value & " for " &
length & " at " & start & " on " & Date & "."
Worksheets("Time Utilisation").TextBoxes("Text Box 2").Text = newtext
Next code
 
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
Looping through a range Shawn[_10_] Excel Programming 2 October 3rd 05 08:51 PM
Clicking the text in a textbox erases all the data in the box dok112[_20_] Excel Programming 4 July 27th 04 01:26 PM
Looping through a range of cells rEN Excel Programming 4 June 10th 04 06:28 PM
Copy range Cell text and font properties to a Textbox BC[_3_] Excel Programming 3 March 3rd 04 07:32 PM
looping through a range Jo[_6_] Excel Programming 1 October 21st 03 11:11 PM


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