CONCATENATE vs TEXTJOIN

CONCATENATE vs TEXTJOIN

 

Hello everybody!

In this article, I invite you to say goodbye to the old CONCATENATE function that when we wanted to add a space or any other character while concatenating the data, obliged us to do it one by one and thus that was very laboring, and say welcome to a more efficient function. If you need to join the data in multiple cells and add characters like a space, comma, semi colon, and hyphen; there is just one function that you need to use and that is the TEXTJOIN function.

 

WHAT DOES IT DO 

Like I mentioned above, you don’t need to click cells one by one and use an expression like ;” “; to add a space in between each time  or a statement like & ” ” & when joining with the & character in the textjoin function. It joins each cell in the selected cell range by adding the slicer we’ve indicated. This way, we can join the data in hundreds of cells easily as a text.

 

SYNTAX

TEXTJOIN(delimiter, ignore_empty, text1, [text2], …)

There are 3 main arguments in the function.

These 3 main arguments are required, the other arguments are optional.Now let’s take a look at what these arguments mean, i.e. what the function wants from us and what we will give it.

 

delimiter
(required)
A text string, either empty, or one or more characters enclosed by double quotes, or a reference to a valid text string. If a number is supplied, it will be treated as text.
ignore_empty
(required)
If TRUE, ignores empty cells.
text1
(required)
Text item to be joined. A text string, or array of strings, such as a range of cells.
[text2, …]
(optional)

Additional text items to be joined. There can be a maximum of 252 text arguments for the text items, including text1. Each can be a text string, or array of strings, such as a range of cells.

 

WORKING CONDITIONS

  • If the resulting string exceeds 32767 characters (cell limit), TEXTJOIN returns the #VALUE! error.
  • It came with Microsoft Excel 2019. If you are using and older Office version, you will get the #NAME? error and thus not be able to use this function.
  • If you Office 2019 or Office 365, you can easily use this function.

 

USING THE FUNCTION

After we write the function name, we specify the delimeter. And then we will choose how it should behave about the possible blank cells in the cell range. And in the last arguments, we choose the cell range to be joined. Now, let’s take a look at its use together.

 

In the example below, we join the data between the A and G columns with a semi colon in between them.

 

As you see, it is as easy as that to join a multiple cell range in a single text with any character between them.

 

See you in another articles, bye. 🙋🏻‍♂️
You can share this post with your friends and help them get informed as well.👍🏻

Office App Has Been Renewed for Android and iOS

New Office App

Hello everybody,

Working from home has been inevitable during these times where online working systems have become prominent and even an obligation. Being able to work on one application while a lot of digital applications come into our life makes us faster and most productive in business processes.

At this point, we can say that all applications have become more visually appealing since Microsoft started to use Material design. Of course they also added very successful features to all applications. Now; Excel, Word and PowerPoint seem to have come together in one Office App in both Android and iOS devices. Which means that you will be able to access you Excel, Word and PowerPoint apps in one application.

 

 

Excel, Word and PowerPoint in One Single App

View, edit and share documents without having to change between multiple apps. We recommend you to try this new experience with its design and new features. 👍🏻

 

 

You can download the new application here:

 

New Features

  • Create PDFs from images or Word, Excel and PowerPoint documents instantly.
  • Sign PDFs with your fingers.
  • Take quick notes with sticky notes.
  • Scan QR codes to open links.
  • Take a picture of a documents and turn it into an editable Word document with one button.
  • Turn a table’s picture to an Excel e-table to be able to work with your data.
  • Let PowerPoint help you to create a presentation by choosing the pictures you want to use from your phone.
  • Create advanced digital images of white boards and documents with the Office Lens features that are integrated to the app.

 

 

You will love the promotional videos.🤗

 

IDEAS

In this article, I will be talking about the Ideas fikirler/ideas  feature of Excel.

 

Explore your data in more detail with Ideas.

The Ideas button -one of the new features- explores the order within your data and offers smart and custom ideas by using that.
Ideas in Excel empowers you to understand your data through natural language queries that allow you to ask questions about your data.
Simply click a cell in a data range, and then click the Ideas button on the Home tab.
Ideas in Excel will analyze your data, and return interesting visuals about it in a task pane.

 

fikirler tablo

 

Creates dozens of artificial intelligence analysis and reports from the data in your table for you.

 

excel fikirler gif

 

On which data do Ideas work?

Ideas work best when data is formatted as an Excel table with a single title row on top.

Here is an example:

excel tablo

 

Ideas works best with clean, tabular data.

Here are some tips for getting the most out of Ideas:

  1. Ideas works best with data that’s formatted as an Excel Table. To create an Excel Table, click anywhere in your data and then press Ctrl+T.
  2. Make sure you have good headers for the columns. Headers should be a single row of unique, non-blank labels for each column. Avoid double rows of headers, merged cells, etc.
  3. If you have complicated, or nested data, you can use Power Query to convert tables with cross-tabs, or multiple rows of headers.

Didn’t get Ideas?

Here are some reasons why Ideas may not work on your data:

  • Ideas doesn’t currently support analyzing datasets over 1.5 million cells. There is currently no workaround for this. In the meantime, you can filter your data, then copy it to another location to run Ideas on it.
  • String dates like “2017-01-01” will be analyzed as if they are text strings. As a workaround, create a new column that uses the DATE or DATEVALUE functions, and format it as a date.
  • Ideas can’t analyze data when Excel is in compatibility mode (i.e. when the file is in .xls format). In the meantime, save your file as an .xlsx, .xlsm, or xslb file.
  • Merged cells can also be hard to understand. If you’re trying to center data, like a report header, then as a workaround, remove all merged cells, then format the cells using Center Across Selection. Press Ctrl+1, then go to Alignment > Horizontal > Center Across Selection.

We’re always improving Ideas

Even if you don’t have any of the above conditions, we may not find a recommendation. That’s because we are looking for a specific set of insight classes, and the service doesn’t always find something. We are continually working to expand the analysis types that the service supports.

Here is the current list that is available:

  • Rank: Ranks and highlights the item that is significantly larger than the rest of the items.

Line chart showing Payroll with noticeably higher Spend

  • Trend: Highlights when there is a steady trend pattern over a time series of data.

Line chart showing Spend increasing over time

  • Outlier: Highlights outliers in time series.

Scatter chart showing outliers

  • Majority: Finds cases where a majority of a total value can be attributed to a single factor.

Donut chart showing People accounting for the majority of Spend

See you in other articles, bye. 🙋🏻‍♂️

You can share this post with your friends and help them get informed as well.👍🏻

Methods of Copying a Cell As a Picture

In this article, we will be talking about methods of Copying a cell as a picture in Excel. There are three methods we can use for this action. You will see these methods and our recommendations in our article. You can find a lot of features like this on our blog, don’t forget to follow.

 

WHY DO WE NEED THIS?

Sometimes we want to transfer the image of a range in our table as a picture to other office applications or any application. For example, when we want to copy the selected table range and directly paste on Outlook, Word etc. it will be pasted as a table. This way, it will be possible to be edited. So, it would be better to copy the cell as a picture or paste the copied data as a picture.

 

METHODS OF COPYING A CELL AS A PICTURE

Our first method

is through the Copy as Picture in the Clipboard on the Home tab.

hücreyi resim olarak kopyalama

 

Our second method is choosing the Picture option in the Paste Special Option after selecting and copying the cell range.

özel yapıştırma seçeneği

 

This way, when you paste it as a picture, the data on the picture won’t change when the data in the cell you’ve copied changes. But when you paste as Linked Picture in the paste special options, you can see that the cell changes when you make a change in the cells you’ve copied. This will provide us with a dynamic look.

The same way, you can view the change you make in the cell range you’ve copied in Excel in other Office apps like Word and PowerPoint too by choosing the Paste as Linked Picture option from the paste special options.

 

Now let’s give an example of paste as a Linked Picture. You will see that when we change a data in the copied table, the change will go through in the picture as well.

 

bağlı resim

 

Our third method is to take a picture of the cell range we want with the Camera feature in Excel and then transmit it from the memory to the cell we want to paste the picture into. For this, you can add the Camera feature to the Quick Access Toolbar with these steps:

  • File
  • Options
  • Quick Access Toolbar
  • Commands Not in the Ribbon
  • Camera
  • Add
  • OK

After executing these actions, you will see the Camera Iconhücreyi resim olarak kaydetme kamera özelliği  on the Quick Access Toolbar. I recommend you to have the camera feature there all the time.

Now, let’s see how easy it is to copy and paste the cell as a picture with this feature.

hücreye resim eklemek

 

You can save the cell range as a picture with these methods we’ve shared with you. If you want, you can get extra information on Microsoft Support.

 

See you in other articles, bye. 🙋🏻‍♂️
You can share this post with your friends and help them get informed as well.👍🏻

CONDITIONAL ACTIONS WITH THE IF DECISION STRUCTURE

In this article I will be talking about a must decision/condition structure in macros. At the end of the article, we’ll have learned what IF Decision structure is and how and when to use it.

 

WHAT IS THE IF DECISION STRUCTURE?

This

condition structure is the structure that exists is all programming languages and allows the code blocks to run separately when certain conditions are met or not.

Allows you to execute actions depending on the True/False Boolean value that the indicated condition returns. If the condition is said to be True, the statements under the indicated condition(s) are applied. If the condition is said to be False, the statements indicated after the IF structure are applied. In addition, depending on the situation, if we have indicated the Else or ElseIF statements the control of those rows are done as well and when the outcome returns as True, the indicated commands are applied.

 

WHEN TO USE?

We use this structure when we have a thought/condition that starts with If or if we want to execute a multiple-condition action while coding.  There are a few other Decision/Condition structures other than this one; Select Case, IIF, Choose and Switch structures. Having knowledge of these structure will help you while coding.

 

HOW TO USE?

First, let’s take a look at its syntax, i.e. how we can write this IF structure on VBA.

 

SYNTAX

Here is its syntax.
Blue parts cannot be changed.
Red parts can be changed.

If condition(s) Then
‘Your codes
End If

You can think of its logic as “If this number is bigger than 10, do this…

If we have one condition only, you can use the syntax like this too:
If condition(s) Then ‘Your codes
If there is only one condition, you can remove the End If statement and write the condition next to the Then statement.
The conditions between If and Then statements can be multiple depending on the situation.
For example; If the numbers in the cells of the A column are bigger than 10 and not blank. You can use logical operators like And, Or, Xor.

Here is a little code sample for you to understand this part completely

If sayi > 10 And sayi < 20 Then

You can increase the condition to 2-3-4… by using logical operator in a If .. Then statement. Let’s say that we have some numbers in the A2:A10 call range and we want to write “bigger” on the B column of the numbers bigger 10.

Here is the code we need for this:

Sub IF_Kosul_Yapisi()
    For i = 2 To 10
        If Cells(i, "A") > 10 Then
            Cells(i, "B") = "Büyük"
        End If
    Next i
End Sub

You can see how these codes work in the GIF below.

IF structure

 

MULTIPLE CONDITIONS AND ELSE

If we have multiple conditions and you logically don’t want to execute actions depending on two situations like If it is like this do this, if not do that; you can write this in a line like this:

If Cells(i, "A") > 10 Then Cells(i, "B") = "Büyük" Else Cells(i, "B") = "Küçük"

and you can also write them one under the other with the Else statement. Then, your syntax will be like this:

If condition(s) Then
‘Your Codes If True
Else
‘Your Codes If False
End If

Some sample codes..

If Cells(i, "A") > 10 Then
    Cells(i, "B") = "Büyük"
        Else
    Cells(i, "B") = "Küçük"
End If

The code above writes Bigger to the B column of cells bigger than 10, and Smaller to the smaller ones.

 

ELSEIF

Now, let’s increase out conditions by including the ElseIf statement.
You can think the logic of this syntax as “If it’s like this to this; if not and it’s like that, do that; if not and it’s like the other way, then do that way.” 

Here is the syntax..
If conditions Then
‘your codes
ElseIf conditions Then
‘your codes
ElseIf conditions Then
‘your codes
End If

Let’s have our outcomes written to the Outcome column according to these conditions.

  • If the number is equal to zero, it will say Zero.
  • If the number is equal to 10, it will say Equal.
  • If the number is smaller than 10, it will say Smaller.
  • If the number is bigger than 10, it will say Bigger.

Depending on the conditions we’ve stated, the code we’ll need will be:

Sub Eger_Kosul_Yapısı_2()
    Dim i As Integer
    For i = 2 To Range("A65536").End(3).Row
        If Cells(i, "A") = 0 Then
            Cells(i, "B") = "Sıfır"
        ElseIf Cells(i, "A") = 10 Then
            Cells(i, "B") = "Eşit"
        ElseIf Cells(i, "A") < 10 Then
            Cells(i, "B") = "Küçük"
        ElseIf Cells(i, "A") > 10 Then
            Cells(i, "B") = "Büyük"
        End If
    Next i
End Sub

You can see how these codes work in the GIF below as well.

 

ELSEIF and ELSE TOGETHER

Lastly, if none of the conditions above are suitable for our codes, then we can include the Else statement before the End If row and get another outcome written in the cell as well.

Sub Eger_Kosul_Yapısı_3()
    Dim i As Integer
    For i = 2 To Range("A65536").End(3).Row
        If Cells(i, "A") = 0 Then
            Cells(i, "B") = "Sıfır"
        ElseIf Cells(i, "A") = 10 Then
            Cells(i, "B") = "Eşit"
        ElseIf Cells(i, "A") < 10 Then
            Cells(i, "B") = "Küçük"
        Else
            Cells(i, "B") = "Büyük"
        End If
    Next i
End Sub

 

You can take a look at the Condition Structures in Visual Basic for more details.

 

See you in other articles, bye. 🙋🏻‍♂️
You can share this article with your friends and get them informed as well. 👍🏻

SELECT CASE DECISION STRUCTURE

In this article, I wanted to share some information about the Select Case Decision Structure which is one of the Decision (Condition) Structures in Excel & VBA, a.k.a Excel macros. You can find other articles about Excel & VBA on our blog.

 

WHAT IS THE SELECT CASE DECISION STRUCTURE?

The Select Case Decision Structure

can be used to control comparisons about a data, just like the IF structure.
The values it returns are going to be True or False. When it is True, the code lines under it work. When it is False, if there are other Case conditions, they are controlled.
If there are other Case conditions and they are True, the codes below them are applied.
If there is no other Case conditions or all the Case conditions have returned False, if there are other codes in the procedure, they are applied by getting out the block with End Select.

Even though it is similar to IF (IF Else ElseIf Then) its type is a bit different and if you have multiple conditions, it is way easier to use compared to IF.

 

Here is the Syntax..

Blue

parts cannot be changed.
Red parts can be changed.
Green parts are comment lines.

Select Case Data to be controlled
‘Your Codes
End Select

If we are going to have multiple conditions, than Case Is or Case statements come into the play. We also have the Case Else statement that allows us to say “do this if the controlled data is outside indicated conditions.”

Select Case Data to be controlled
Case Is Condition
‘Your codes
Case Is Condition
‘Your codes
Case Is Condition
‘Your codes
Case Else
‘Your codes
End Select

If you want, you can write to codes in the same row after the condition part with : (colon). Case Is Condition: Your Codes
If we use a comparison operator (<; <=; =; >; >=) while indicating a condition, Case Is statement is written for the condition. If not, Case statement will be enough. You will see this situation in the examples below.

We used this statement for the Select Case structure above: “If you have multiple conditions, it is way easier to use compared to IF.”
Let’s give an example of this. We will apply the same conditions with both the IF structure and the Select Case structure and see the difference.
Our conditions will be like this: we have a value and we’ll have it checked. If this value is smaller than 1, we will return the outcome with MsgBox. Likewise, if it is between 1 and 5 or 6 and 10 or 11 and 15, we’ll return the outcome with MsgBox. We will prepare this separately with both of the structures.

 

Let’s start. First, the codes that we will need if we write our codes depending on the conditions above with the IF structure are:

Sub IF_Yapisi_ile_1()
For i = 1 To 10
If Cells(i, 1).Value < 1 Then
MsgBox "Değer 1'den küçüktür."
ElseIf Cells(i, 1).Value >= 1 And Cells(i, 1).Value <= 5 Then
MsgBox "Değer 1 ile 5 arasındadır."
ElseIf Cells(i, 1).Value >= 6 And Cells(i, 1).Value <= 10 Then
MsgBox "Değer 6 ile 10 arasındadır."
ElseIf Cells(i, 1).Value >= 11 And Cells(i, 1).Value <= 15 Then
MsgBox "Değer 11 ile 15 arasındadır."
End If
Next i
End Sub

 

If we want to write our codes in different IF rows for each condition and simplify it, then we can write it like this:

Sub IF_Yapisi_ile_2()
For i = 1 To 10
If Cells(i, 1).Value < 1 Then MsgBox "Değer 1'den küçüktür."
If Cells(i, 1).Value >= 1 And Cells(i, 1).Value <= 5 Then MsgBox "Değer 1 ile 5 arasındadır."
If Cells(i, 1).Value >= 6 And Cells(i, 1).Value <= 10 Then MsgBox "Değer 6 ile 10 arasındadır."
If Cells(i, 1).Value >= 11 And Cells(i, 1).Value <= 15 Then MsgBox "Değer 11 ile 15 arasındadır."
Next i
End Sub

 

Now let’s see how we will write the same conditions with the Select Case statement.

Sub Select_Case_Yapisi_ile()
For i = 1 To 10
Select Case Cells(i, 1).Value
Case Is < 1: MsgBox "Değer 1'den küçüktür."
Case 1 To 5: MsgBox "Değer 1 ile 5 arasındadır."
Case 6 To 10: MsgBox "Değer 6 ile 10 arasındadır."
Case 11 To 15: MsgBox "Değer 11 ile 15 arasındadır."
Case Else: MsgBox "Değer 15'den daha büyüktür."
End Select
Next i
End Sub

 

We saw that we can execute the action we want with three different codes and we can increase this number, but I hope that you can see the difference between them.
With the IF structure, we had to indicate Cells(i, 1).Value –the cell address that we were going to have controlled and we wrote it many times to indicate the condition between two numbers. But with Select Case, it was enough for us to write the cell address that we were going to have controlled and it was very easy to indicate the condition between two numbers as 1 To 5.

Let’s see the outcome with the Select Case structure in a GIF.

select case karar yapısı vba

 

CODE SAMPLES

You can apply the Select Case application samples below and test how it works and comprehend its logic better.

Sub Makro1()
Select Case "Murat" = "Emre"
Case True: MsgBox "İfade Doğrudur."
Case False: MsgBox "İfade Yanlıştır."
End Select
End Sub

 

Sub Makro2()
Dim Değer As Integer
Değer = 2
Select Case Değer
Case 1: MsgBox "Değer 1'dir."
Case 2: MsgBox "Değer 2'dir."
Case 3: MsgBox "Değer 3'tür."
Case Else: MsgBox "Değer Mevcut Değil."
End Select
End Sub

 

Sub Makro3()
Dim Değer As Integer
Değer = 1
Select Case Değer
Case Is < 1: MsgBox "Değer Küçüktür."
Case Is = 1: MsgBox "Değer Eşittir."
Case Is > 1: MsgBox "Değer Büyüktür."
End Select
End Sub

 

Sub Makro4()
Dim Metin As String
Metin = "PEAKUP"
Select Case Metin
Case "Excel": MsgBox "Metin Excel'dir"
Case "PEAKUP": MsgBox "Metin PEAKUP'tır."
Case "VBA": MsgBox "Metin VBA'dır."
End Select
End Sub

 

Sub Makro5()
Dim Değer As Integer
Değer = 14
Select Case Değer
Case Is < 1: MsgBox "Değer 1'den küçüktür."
Case 1, 2, 3, 4, 5: MsgBox "Değer 1 ile 5 arasındadır."
Case 6, 7, 8, 9, 10: MsgBox "Değer 6 ile 10 arasındadır."
Case 11, 12, 13, 14, 15: MsgBox "Değer 11 ile 15 arasındadır."
Case Else: MsgBox "Değer 15'den daha büyüktür."
End Select
End Sub

 

Sub Makro6()
Dim Değer As Integer
Değer = 20
Select Case Değer
Case Is < 1: MsgBox "Değer 1'den küçüktür."
Case 1 To 9: MsgBox "Değer 1 ile 9 arasındadır."
Case 10 To 19: MsgBox "Değer 10 ile 19 arasındadır."
Case 20 To 29: MsgBox "Değer 20 ile 29 arasındadır."
Case Else: MsgBox "Değer 29'dan büyüktür."
End Select
End Sub

 

Sub Makro7()
Dim Değer As Long
Değer = 15
Select Case Değer
Case Is < 1: MsgBox "Değer 1'den küçüktür."
Case 1 To 4, 5 To 9: MsgBox "Değer 1 ile 9 arasındadır."
Case 10 To 14, 15 To 19: MsgBox "Değer 10 ile 19 arasındadır."
Case 20 To 24, 25 To 29: MsgBox "Değer 20 ile 29 arasındadır."
Case Else: MsgBox "Değer 29'dan büyüktür."
End Select
End Sub

 

Sub Makro8()
Dim Tanım As String
Tanım = "C"
Select Case Tanım
Case Is < "E": MsgBox Tanım & " harfi E harfinden önce gelir."
Case Is > "E": MsgBox Tanım & " harfi E harfinden sonra gelir."
End Select
End Sub

 

Sub Makro9()
Dim Tanım As String
Tanım = "E"
Select Case Tanım
Case "A" To "M": MsgBox Tanım & " harfi A ile M harfleri arasındadır."
Case "N" To "Z": MsgBox Tanım & " harfi N ile Z harfleri arasındadır"
Case Else: MsgBox "Case Else"
End Select
End Sub

 

You can cat more detailed information about the Select Case statement on Microsoft Docs.

 

See you in other articles, bye. 🙋🏻‍♂️
You can share this post with your friends and help them get informed as well.👍🏻

MASS E-MAIL WITH EXCEL THROUGH OUTLOOK

In this article, I will be talking about how we can execute an action which I know that many users need in Excel Training. Without further ado, let’s see how we can send a mass e-mail with Excel through Outlook.

excel toplu mail

First of all, we will be sending mass e-mails with Excel through Outlook with the power of VBA, a.k.a macros. So, it wouldn’t hurt you to know a bit about macros but I will be explaining the topic simply and since a lot of the code lines are cliche, it is not a must for you to know about macros. Also, I will be indicating what each code line means. First, I will give you all the codes. And then I will be explaining them. Of course, it can be enhanced way more but for now I will be explaining how to send a mass e-mail with a simple method. In addition, I will attach a sample file.

Let’s start.👍🏻

 

First, let’s assume that we have a table like this.
When we push the Send button, we will send all the e-mails starting from the 2nd row to the last row.

excelvba mail listesi

 

Send a Mass E-Mail with Excel through OUTLOOK – ALL CODES

Sub PEAKUP_Mail_Send()
   Dim Outlook As Object, newAs Object, i As Long
   Set Outlook = CreateObject("Outlook.Application")
   For i = 2 To Cells(Rows.Count, "A").End(3).Row
      Set new = Outlook.CreateItem(0)
      With new
         .To = Range("B" & i).Value
         .Subject = Range("C" & i).Value
         .Body = Range("D" & i).Value
         .Display
         '.Send
     End With
   Next i
   Set Outlook = Nothing: Set new= Nothing: i = Empty
   MsgBox "Your e-mails have been sent.", vbInformation, Application.UserName
End Sub

Yeap, these codes are all we need. Now, let’s move on to what each code line does. As I stated below, you can think of all the codes below as a template/cliche. It will be enough for you to take these codes and set to, subject and description parts according to your file.

 

Sub PEAKUP_Mail_Send()

We name our Macro/Procedure PEAKUP_Mail_Send.

Dim Outlook As Object, new As Object, i As Lon

We define the variables we’ll use. It is not a must to define variables but it is pretty helpful. I will be talking about the details in our article about variables and defining methods.

Set Outlook = CreateObject("Outlook.Application")

We created the Outlook application with the Late Binding method. (There are two methods; Early Binding and Late Binding)

For i = 2 To Cells(Rows.Count, "A").End(3).Row

We create a For loop from the 2nd row to the last filled row number in the A column. We use it to send the mail to all the addresses in all rows.

Set new= Outlook.CreateItem(0)

We create a new mail by setting just like pushing the New button in Outlook.

With new

Since the codes below indicate the fields in the new mail, in order not to write “new” each time, we say With new and indicate that it has to do with the new mail. If you pay attention, the codes continue as .To  – .Subject. So, they are all lines about the New mail.

.To = Range("B" & i).Value

We determine who we’ll send the mail to. Here we indicate that it will be sent to those on the B column.

.Subject = Range("C" & i).Value

We determine the subject. We indicate that the subjects are the ones on the C column.

.Body = Range("D" & i).Value

And we request the ones on the D column to be written into the mail body.

.Display

It enables you to display the mail before you send it.

.Send

Sends the mail.

End With

We must close the With statement with End With.

Next i

We request it to move on to the next line in the loop.

Set Outlook = Nothing: Set new= Nothing: i = Empty

We empty the created variable. It is not a must, but helps to not hold up space in storage.

MsgBox "Your e-mails have been sent.", vbInformation, Application.UserName

With MsgBox, we get a information window indicating that mails have been sent.

End Sub

We end our macro/procedure.

 

 

ADD EXTRA INFORMATION TO THE MAIL

Add a File

If you want, you can add a file in your computer with the code below to your mail. You can write the code line below under the .To – .Subject statements.

.Attachments.Add "file location"

Make the Look of The Text in the Message Body HTML

Instead of using .Body and writing a plain text, you can use .HtmlBody and make the text visually pleasing with html tags.

For example;

.HTMLBody = "

Add CC and BCC

If you want to add other people to the CC or BCC, you can write these codes under the .To line.

.CC = "Mail address to be added to CC
.BCC = "Mail address to be added to BCC

Set the Importance of the Mail

If you want to send your mail with high importance, you can add this code line.

.Importance = 2

 

Well… if you have analyzed and learned everything I have written so far, we can move on to the application part. 😃

 

When we run the codes, the mails will be sent to all the addresses like in the GIF below.

Note: If you activate .Send instead of .Display, the mails will be sent without displaying. 

excelvba outlook ile mail göndermek

 

You can download the application file here 👉🏻  .
And here is another example for you.

 

See you in other articles, bye. 🙋🏻‍♂️
You can share this post with your friends and help them get informed as well.👍🏻

Hello,
” & Range(“D” & i).Value & “

The SEQUENCE Function

In this article I will be talking about the SEQUENCE Function that is one of the dynamic array functions. It allows us to create a list of sequential numbers in an array when we want to give a sequence number in a column or we give a starting number and indicate the increase value. We can easily use it when we need to quickly create a data set. You can find articles about other functions on our blog.

 

WHAT DOES IT DO

The SEQUENCE Function -like I mentioned above- is a function similar to the Flash Fill option in the Fill field in Excel. For example, when we want to give a sequence number from 1 to 20, it is going to be enough for us to write =SEQUENCE(20). Or let’s say that you are going to create a 10-row and 5-column numeral data table. When we want these numbers to start from a certain number and increase by the value we indicate and fill the sequence like that, we can use this function. We can do extra special actions with the numeric values this functions returns us.

 

SYNTAX

=SEQUENCE(rows,[columns],[start],[step])

This function has 4 arguments.
The first one of these arguments is required and the other 3 are optional.

Now let’s take a look at what these arguments mean, i.e. what this function wants from us and what we will give it.

sıralı fonksiyon argümanları listesi

 

WORKING CONDITIONS

  • Any missing optional arguments will default to 1.
  • An array can be thought of as a row of values, a column of values, or a combination of rows and columns of values. In the example above, the array for our SEQUENCE formula is range C1:G4.

  • The SEQUENCE function will return an array, which will spill if it’s the final result of a formula. This means that Excel will dynamically create the appropriate sized array range when you press ENTER. If your supporting data is in an Excel table, then the array will automatically resize as you add or remove data from your array range if you’re using structured references. For more details, see this article on spilled array behavior.
  • Excel has limited support for dynamic arrays between workbooks, and this scenario is only supported when both workbooks are open. If you close the source workbook, any linked dynamic array formulas will return a #REF! error when they are refreshed.

 

USE OF THE FUNCTION

If you want, you can try to give a sequence number in a column. We can obtain a sequence of numbers starting from 1 for the specified number of rows and columns. If you wish, you can increase step by step by using the increment value. Let’s take a look at how to use the function.

sıralı fonksiyonu kullanımı

 

SPLIT THE DATA INTO COLUMNS EASILY

Now let’s have an example of the use in extra special actions…
Let’s assume that there are dozens, hundreds, thousands of row of data in the A column, and you want to split that data into a few columns. Now, we can create the list easily with the numbers it returns with the logic of this function. In the example below, there are 16 rows of data in the A column. Let’s get these written equally in the A and B columns with a row gap.

 

sıralı function farklı kullanımı

 

See you in other articles, bye. 🙋🏻‍♂️
You can share this article with your friends and help them get informed. 👍🏻

coder by

CREATE CUSTOM LISTS IN EXCEL

In this article, we will be talking about how to create a Custom Menu depending on your needs in Excel without any codes. You can find articles about other features on our blog.

 

ENJOY YOUR OWN CUSTOM LIST

As you know, there are a lot of menus and tons of features in those menus in Excel, from File Menu to Help menu. Sometimes we spend a lot of time looking for a feature in menus or there are features in menus that we don’t use at all. And sometimes, we are just up for a change. 😃 In all these case, you can create your own custom menu and place it anywhere you want, and just do all actions within that menus. And on top of that, you don’y need any UI Editor to execute this action.

özel menü

 

WHERE TO START?

To create a custom menu, we need to go to the  Customize Ribbon field in the Excel Options. There are two ways to go there.

The 1st way:

  • File
  • Options
  • Customize Ribbon

 

The 2nd way: 

  • Customize Quick Access Toolbar
  • Other Commands
  • Customize Ribbon

 

The window we’ll access through both ways will be this one.

şeridi özellştir

 

Come to this window, choose the Help menu and create a new tab/menu by clicking the New Tab button.

Choose New Tab (Custom), click “Rename” and name the new tab. For example, let’s type in PEAKUP. You can choose “New Group” and name it based on the features you’ll add. For now, we can call it Data Analysis.

Now we can add the features/commands we use the most to this menu.

 

If you want, you can do all the actions we’ve covered so far like in the image below.

özel menü ekle

 

If you right-click the Data Analysis group and choose Hide Command Labels options,

 

komut etiketlerini gizle

Your command will be seen as mini commands in the menu like this.mini etiket

 

You can add multiple groups into a menu by creating New Groups. Or you can create New Menus with the New Tab button and place it in the first place after the File menu.

özel menü yeni

I say create menus like this for a while and just try it out. 😄 You can check here for more details.

 

 

See you in other articles, bye. 🙋🏻‍♂️
You can share this post with your friends and help them get informed as well.👍🏻

LET : THE NEWEST FUNCTION

This week I will be talking about a function recently announced by Microsoft that only the Office Insider users can use: the LET Function. Like I mentioned in the FILTER function article, as the new dynamic string functions we will be able to execute a lot of actions more simply and quickly. And new features keep coming one after another. You can easily keep up-to-date by following our articles. 👍🏻

 

DEFINITION OF THE LET FUNCTION

In the announcement the definition goes like:

Have you ever had to repeat the same expression multiple times within a formula, created a mega formula or wished that you had a way to reuse portions of your formula for easier consumption? With the addition of the LET function, now you can!

The LET function assigns names to calculation results and makes it easier for you to reuse the parts of the formula. In a way, it means that we can Define Names in a function and use the name in calculation. Sometime when we are writing a formula, we need to state the same range or condition multiple time. the LET function will be helping as right at this point. We will name the value we have to use multiple times in a formula and we’ll indicate it with that name in the function.

The main benefits are:

1. Readability

No more having to remember what a specific range/cell reference referred to, what your calculation was doing or duplicating the same expression within a formula. With the ability to name expressions, you can give meaningful context to readers of your formula.

2. Performance

If you reuse the same expression multiple times in a formula, Excel calculates that expression multiple times. LET allows you to name the expression and refer to it using that name. Any named expression is calculated only once, even if it is referred to many times in the formula. This can significantly improve performance for computationally complex expressions.

 

SYNTAX

LET

(name1, value1, [name2…], [value2…], calculation)

let fonksiyonu

This function consists of 3 basic arguments. Name and value arguments can be optionally increased.

The 3 basic arguments are required. For the function to work, there has to be indicated value and calculation arguments.

Let’s take a look at these arguments.

  • name1: The name for the 1st value
  • value1: The value to associate with the 1st name
  • name2 (optional): Additional names
  • value2 (optional): Additional values
  • calculation: The calculation to perform. This is always the final argument and it can refer to any of the defined names in the LET.

 

Deconstructing the parameters, there are two things to make note of

  1.  The names and their values must be in pairs. If there is a name but there is not a value, the function doesn’t work.
  2. The last parameter of the function is the calculation which can use the values you named. A properly structured LET will have an odd number of arguments.

 

ADDITIONAL REMARKS 

  • The last argument should be a calculation that returns a result.
  • Argument names are limited with the names that can be used in the Name Manager. For example, “a” is valid but “c” will not be a valid name since it coincides with the R1C1 reference styles.

 

This example will help you comprehend it better:

=LET(total; SUM(A1:A10); total * 3)

Let me give another example so that the software people can comprehend it better: in the formula below, I have created a variable called sum and gave it the 1 value. In the calculation part, I said add +2 to the sum variable and as a result, this function will return the result of 3.

=LET(SUM; 1; SUM+2)

If we want to take this a step further, I mean if we want to give double names and values, we can use it like this:

=LET(total, SUM(A1:A10), count, COUNT(A1:A10), total / count)

Here is another example:

izinver fonksiyon örneği

Here, you need to FILTER the Fred in the first column with the new FILTER dynamic string and if there is a blank cell, you need to enter – (hyphen) icon.

Normally, we can solve this with a formula like this; if there is a blank cell in the result coming from the filter, write hyphen there, if there is no blank cells filter normally.

=IF(ISBLANK(FILTER(A2:D8;A2:A8="Fred"));"-";FILTER(A2:D8;A2:A8="Fred"))

But if you have noticed, we wrote this part twice in the formula; FILTER(A2:D8;A2:A8=”Fred”)

LET function says that you don’t need to write the same data twice.

=LET(filterCriteria, “Fred”, filteredRange, FILTER(A2:D8,A2:A8=filterCriteria),

IF(ISBLANK(filteredRange),”-“,filteredRange))

 

Let me give another example of this beautiful function and than end my article: 😊

izinver fonksiyonu

The formula we need to write when we want to find the total data of February based on the conditions indicated above in D2 and D3 in the table above:

=IF(SUMIFS($C$2:$C$8;$A$2:$A$8;$D$2;$B$2:$B$8;">="&$D$3)<0;"Sum Incorrect";SUMIFS($C$2:$C$8;$A$2:$A$8;$D$2;$B$2:$B$8;">="&$D$3))

As you can see, we used SUMIFS two times in IF. We had to write it like that depending on our need.

But if we are to do it with the LET function, we only need to write the SUMIFS function once.

=LET(Sum;SUMIFS($C$2:$C$8;$A$2:$A$8;$D$2;$B$2:$B$8;">="&$D$3);IF(Sum<0;"Incorrect";Sum))

 

So much for the information I will share with you for now. If you want you can get more information here. As we start using this function in our daily lives, we will be sharing it with you. ⚡️

 

See you in other articles, bye. 🙋🏻‍♂️

You can share this post with your friends and help them get informed as well.👍🏻