Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 698
Default Start a new column if list gets too long

Hello Excel Expert and Users,

This code produces a column of Comment boxes on sheet "Your Notes" if a
certain value happens on another sheet, the value "L" or "LE".

I would like to start a new column of comment boxes if the comments reach
row 30 in column A. Move over to column E and put the comments there until
it reaches row 30 and move over to column I and then to column M.

Private Sub Worksheet_Change(ByVal Target As Range)
Dim i As Integer
Dim j As Integer
i = Target.Row
j = Target.Column

On Error Resume Next
If Intersect(Target, Range(j & ":" & i)) Is Nothing Then
Exit Sub
Else
If Intersect(Target, Range(j & ":" & i)).Value = "L" Then
Sheets("Your Notes").Activate
Sheets("Your Notes").Range("A100").End(xlUp).Offset(2, 0).Select
With Selection
.Value = "Late"
.AddComment
.Comment.Text Text:=Sheets("Main Sheet").Cells(12, j).Value & _
Chr(10) & Cells(i, "D").Value
.Comment.Visible = True
End With
End If
If Intersect(Target, Range(j & ":" & i)).Value = "LE" Then
Sheets("Your Notes").Activate
Sheets("Your Notes").Range("A100").End(xlUp).Offset(2, 0).Select
With Selection
.Value = "Left early"
.AddComment
.Comment.Text Text:=Sheets("Main Sheet").Cells(12, j).Value & _
Chr(10) & Cells(i, "D").Value
.Comment.Visible = True
End With
End If
End If
End Sub

Thanks for any help.
Regards,
Howard


  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 698
Default Start a new column if list gets too long

For the record, I was able to solve my problen using "GoTo".

Regards,
Howard

"L. Howard Kittle" wrote in message
. ..
Hello Excel Expert and Users,

This code produces a column of Comment boxes on sheet "Your Notes" if a
certain value happens on another sheet, the value "L" or "LE".

I would like to start a new column of comment boxes if the comments reach
row 30 in column A. Move over to column E and put the comments there
until it reaches row 30 and move over to column I and then to column M.

Private Sub Worksheet_Change(ByVal Target As Range)
Dim i As Integer
Dim j As Integer
i = Target.Row
j = Target.Column

On Error Resume Next
If Intersect(Target, Range(j & ":" & i)) Is Nothing Then
Exit Sub
Else
If Intersect(Target, Range(j & ":" & i)).Value = "L" Then
Sheets("Your Notes").Activate
Sheets("Your Notes").Range("A100").End(xlUp).Offset(2, 0).Select
With Selection
.Value = "Late"
.AddComment
.Comment.Text Text:=Sheets("Main Sheet").Cells(12, j).Value & _
Chr(10) & Cells(i, "D").Value
.Comment.Visible = True
End With
End If
If Intersect(Target, Range(j & ":" & i)).Value = "LE" Then
Sheets("Your Notes").Activate
Sheets("Your Notes").Range("A100").End(xlUp).Offset(2, 0).Select
With Selection
.Value = "Left early"
.AddComment
.Comment.Text Text:=Sheets("Main Sheet").Cells(12, j).Value & _
Chr(10) & Cells(i, "D").Value
.Comment.Visible = True
End With
End If
End If
End Sub

Thanks for any help.
Regards,
Howard



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
How to transpose and concatenate long list in one column? CSchwass Excel Worksheet Functions 12 September 11th 09 12:46 AM
Need a formula to 'find' word in cells of column from a long list Deden Excel Worksheet Functions 10 November 26th 08 02:30 AM
Excel Taking Long TIme to Start Sanford Lefkowitz Excel Discussion (Misc queries) 2 June 1st 07 05:35 PM
Print a long 2 page column list, on one page Stella Excel Discussion (Misc queries) 6 May 2nd 07 05:09 AM
how do you keep fields in a column to print out for long list Mike Setting up and Configuration of Excel 1 August 31st 05 09:14 PM


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