In this video we will learn and see
Concatenating string or variable value in VBA.
Getting value from range or cell and concatenating it.
Getting value from user input using Inputbox and concatenating it.
Displaying Double Quotes around text or string.
In VBA we can concatenate/join or text or data using three ways.
& Method
Can join or concatenate any data type (String ,Number)
Data type is implicitly converted into text/string before output no need to first convert non string data in to string.
This is frequently used method for concatenate or join.
Example
1 & 2 will give 12
“1” & “2” will give 12
1 & 2 & “ One” & “ Two” will give 12 One Two
+ Method
Can join only string data type only
Numeric data must be explicitly converted before joining.
Example
1 + 2 will give 3
“1” + “2” will give 12
“1” + “2” + “ One” + “ Two” will give 12 One Two
CStr(1) + CStr(2) + “ One” + “ Two” will give 12 One Two (CStr is VBA function which converts number into string)
1 + 2 + “ One” + “ Two” will give error since 1 and 2 are numbers we need to 1st convert into string (explicit conversion) just like above to have joined or concatenated text.
We can also use worksheet Concat function for joining
Application.WorksheetFunction.Concat(string1,string2,string3)
In all methods string must be enclosed between double quotes (“)
Example
“2” ,”India” etc
====================================================
-Click below link to subscribe channel and stay tuned with latest uploads.
[ Ссылка ]
-Channel link
[ Ссылка ]
If liked this video then please subscribe,like and don't forget to click bell icon.
Make comment about your views, any suggestion or video topic you like to see.
======================================
🌐 Websites 🌐
[ Ссылка ]
🎫 Make your Digital Visiting Card [ Ссылка ]
=====================================================
You can watch and learn from below videos also
How to protect only formula cells in excel (non VBA way). [ Ссылка ]
Auto highlight Active cell VBA.
[ Ссылка ]
Auto highlight Activecell without erasing past cell colour. [ Ссылка ]
How to insert Picture comment box (non VBA) ? [ Ссылка ]
Repeat heading/header row in print pages. [ Ссылка ]
Filter not showing all values of a column. [ Ссылка ]
Grand total is getting sorted or coming in filter. [ Ссылка ]
Join or Concatenate String in VBA
Теги
join text in vbaconcatenate in vbainputbox in vbajoin cell range in vbaconcatenate cell or range value in vbaexcel vbaexcel vba tutorial for beginnersexcel vba tutorial advancedms exceladvance excelexcel tutorial you tubeexcel video tutorialdouble quote in VBAdouble quotes in excel formulaexcel vba advancedmicrosofte excelvbaexcel