Тёмный

Text box in VBA Excel 

Barb Henderson
Подписаться 37 тыс.
Просмотров 988
50% 1

Text box in VBA Excel. How to make and populate text boxes with VBA.
Free templates and templates with code are available for purchase for $50 USD
www.easyexcela...
Addition Templates may be available on request
Click this link to check out my one-on-one training www.calendly.co...
For more help visit my website www.easyexcelanswers.com or email me at easyexcelanswers@gmail.com.
Contact me regarding customizing this template for your needs.
Click for online Excel Consulting www.calendly.co...
Are you struggling to update your Microsoft SQL Server data?
I recommend using well-known Excel to update and manage your data in SQL Server using the SQL Spreads Excel add-in.
Click sqlspreads.com... to find out how SQL Spreads works best for non-technical end users and download our free 14-day trial. You will get two months free when purchasing an annual subscription using our link.
I am able to provide online help on your computer at a reasonable rate.
Check out Crowdcast for creating your webinars
app.linkmink.c...
I use Tube Buddy to help promote my videos
Check them out
www.Tubebuddy....
Follow me on Facebook
/ easyexcel.answers
IG @barbhendersonconsulting
You can help and generate a translation to you own language
www.youtube.com...
*this description may contain affiliate links. When you click them, I may receive a small commission at no extra cost to you. I only recommend products and services that I've used or have experience with.
How to insert VBA code in Excel • How to insert VBA code...
Sub textbox()
'create a textbox
Dim str As String
Dim ws As Worksheet
Set ws = Sheet3
ws.Cells(7, 3).Select
ws.shapes.AddTextbox(msoTextOrientationHorizontal, _
100, 100, 200, 200) _
.TextFrame.Characters.Text = ""
'mydocuments.shapes.Select
For Each oneShape In ws.shapes
oneShape.Select Replace:=False
'Next oneShape
Selection.copy
r = 7
C = 2
ws.Cells(r, 8).Select
ActiveSheet.Paste
ws.Cells(r, 13).Select
ActiveSheet.Paste
ws.Cells(r, 18).Select
ActiveSheet.Paste
Next
Call addtext
End Sub
Sub addtext()
Dim oTextBox As textbox
Dim data, ws As Worksheet
Dim com, addr As String
Dim city, prov As String
Dim pc As String
Dim r As Long
Set ws = Sheet3
Set data = Sheet2
r = 2
ws.Activate
For Each oTextBox In ws.TextBoxes
com = data.Cells(r, 1).Value
addr = data.Cells(r, 2).Value
city = data.Cells(r, 3).Value
prov = data.Cells(r, 4).Value
pc = data.Cells(r, 5).Value

oTextBox.Select
Selection.ShapeRange(1).TextFrame2.TextRange.Characters.Text = _
com & vbLf & addr & vbLf & city & vbLf & prov & vbLf & pc
r = r + 1
Next oTextBox

End Sub
Sub delettxt()
Dim oTextBox As textbox
Sheet3.Activate
For Each oTextBox In ActiveSheet.TextBoxes
oTextBox.Delete
Next oTextBox
End Sub

Опубликовано:

 

11 сен 2024

Поделиться:

Ссылка:

Скачать:

Готовим ссылку...

Добавить в:

Мой плейлист
Посмотреть позже
Комментарии : 2   
@Deepak_Singh1008
@Deepak_Singh1008 4 месяца назад
Thanks for sharing the knowledge
@BarbHendersonconsulting
@BarbHendersonconsulting 4 месяца назад
My pleasure
Далее
5 Excel Secrets You'll Be Embarrassed You Didn't Know
17:32
Create and use a toggle button in Excel
5:20
Просмотров 2,7 тыс.
УДОЧКА ЗА 1$ VS 10$ VS 100$!
22:41
Просмотров 230 тыс.
Эконом такси в твоем городе 😂
00:59
10X Your Excel with Macros & Basic VBA
11:18
Просмотров 83 тыс.
Schedule follow up for clients in Excel
6:57
Try This Instead of the XLOOKUP
10:06
Просмотров 60 тыс.