ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   VBA problem - (https://www.excelbanter.com/excel-programming/287358-vba-problem.html)

Bourbon[_6_]

VBA problem -
 
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

--
Message posted from http://www.ExcelForum.com


Dave Peterson[_3_]

VBA problem -
 
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


"Bourbon <" wrote:

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

Can this be done? Thanks alot for any help,

Regards,
Bourbon

---
Message posted from http://www.ExcelForum.com/


--

Dave Peterson


Bourbon[_9_]

VBA problem -
 
Thank you very much, it works fine. You have been a great help! Thank
again.


--
Message posted from http://www.ExcelForum.com



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

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com