Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 55
Default I need help with VB code

Thanks, Per. Very helpful. I just replied to Joel also... I appreciate this
feedback so much since I am learning VBA as I go! Having two different ways
of accomplishing this problem helps me learn this more!! Have a great
holiday.

"Per Jessen" wrote:

hI

Try if this is what you need.

Sub AAA()
Set OutputSh = Sheets("sheet2")
Set StartCell = Range("A2")
lastrow = StartCell.End(xlDown).Row
For r = 2 To lastrow
Output = Cells(r, 1).Value & " "
For c = 3 To 10
If Cells(r, c).Value = "T" Then
Output = Output & c - 3 & ", "
End If
Next
Output = Left(Output, Len(Output) - 2)
OutputSh.Range("A1").Offset(off, 0) = Output
off = off + 1
Next
End Sub

Regards
Per

On 20 Nov., 01:33, ILoveMyCorgi
wrote:
I have an Excel file:
# Date Per0 Per1 Per2 Per3 Per4 Per5 Per6
Per7
10001 8/25/2008 T T T T T
T
etc. for approximately 50 rows with different data

The output to display on a new worksheet as follows:
10001 0, 1, 3, 4, 5, 7 [there needs to be a space after the comma]

If I can get help on this I'd be appreciative. Thanks for all your help.



Reply
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
split post code (zip code) out of cell that includes full address Concord Excel Discussion (Misc queries) 4 October 15th 09 06:59 PM
Run VBA code only worksheet change, but don't trigger worksheet_change event based on what the code does ker_01 Excel Programming 6 October 3rd 08 09:45 PM
Shorten code to apply to all sheets except a few, instead of individually naming them, and later adding to code. Corey Excel Programming 3 December 11th 06 05:14 AM
Protect Sheet with code, but then code will not Paste error. How do i get around this. Please read for explainations.... Corey Excel Programming 4 November 25th 06 04:57 AM
Excel code convert to Access code - Concat & eliminate duplicates italia Excel Programming 1 September 12th 06 12:14 AM


All times are GMT +1. The time now is 03:10 AM.

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"