VBA problem -

B

Bourbon

I am trying to write a code that will the do following: I have
columms(A,B,C,D) with data (with unlimited number of lines/data in eac
columm), I want to have the program search down the 3rd columm (C) an
when ever it finds an entry, to create a text box besides columm D a
the same line number.

Can this be done? Thanks alot for any help,

Regards,
Bourbo
 
D

Dave Peterson

I used the textbox from the Drawing toolbar:

Option Explicit
Sub testme()

Dim myCell As Range
Dim myRng As Range

With Worksheets("sheet1")

.TextBoxes.Delete 'delete all existing textboxes???

Set myRng = .Range("c1", .Cells(.Rows.Count, "C").End(xlUp))
For Each myCell In myRng.Cells
If IsEmpty(myCell) Then
'do nothing
Else
With myCell.Offset(0, 1)
.Parent.Shapes.AddTextbox _
Orientation:=msoTextOrientationHorizontal, _
Top:=.Top, Left:=.Left, Width:=.Width, Height:=.Height
End With
End If
Next myCell
End With
End Sub
 
Top