andrewb90
Well-known Member
- Joined
- Dec 16, 2009
- Messages
- 1,077
Hello all,
I have this code that takes info from a cell and puts it in comments, but when it does, excel always needs to restart as a result of the systems resources getting used it and causing major lag. I was wondering if anybody could give me insight into what exactly causes this, and if there is a cure.
Thanks,
Andrew
I have this code that takes info from a cell and puts it in comments, but when it does, excel always needs to restart as a result of the systems resources getting used it and causing major lag. I was wondering if anybody could give me insight into what exactly causes this, and if there is a cure.
Code:
Private Sub CellToComment()'Updateby20140509
'Note: Will not add comment if blank, will clear comment if notes deleted
Dim Rng As Range
Dim WorkRng As Range
On Error Resume Next
Sheets("Scheduler").Select
ActiveSheet.Unprotect "majinbuu"
'xTitleId = "KutoolsforExcel"
'Set NoteRng = Range("S89:S100").SpecialCells(xlCellTypeVisible)
Set CmtRng = Sheets("Scheduler").Range("D89:D207").SpecialCells(xlCellTypeVisible)
'Set WorkRng = Application.Selection
'Set WorkRng = Application.InputBox("Range", xTitleId, WorkRng.Address, Type:=8)
For Each Rng In CmtRng 'this is where it's gonna print
'Rng.NoteText Text:=Rng.Value
'Rng.NoteText Text:=Sheets("Master Availability").Range("S" & Rng.Row)
If Sheets("Master Availability").Range("S" & Rng.Row) = "" Then
Sheets("Scheduler").Range("D" & Rng.Row).ClearComments
Else
Rng.NoteText Text:=Sheets("Master Availability").Range("D" & Rng.Row) & ":" & vbNewLine & Sheets("Master Availability").Range("S" & Rng.Row)
End If
'.Offset(rowOffset:=0, columnOffset:=-1)
Next
End Sub
Andrew