# Rubayed Razib Suprov

Rubayed Razib, holding a BSC degree in Naval Architecture & Engineering from Bangladesh University of Engineering and Technology, serves as a devoted member of the ExcelDemy project. He has contributed significantly by authoring numerous articles and showcasing proficiency in VBA. Razib efficiently automates Excel challenges using VBA macros and actively participates in the ExcelDemy forum, providing valuable solutions for user interface challenges. Apart from creating Excel tutorials, he is interested in Data Analysis with MS Excel, SPSS, Python Web Scraping, and Report Writing.

## Designation

Excel & VBA Content Developer at ExcelDemy in SOFTEKO.

## Education

B.Sc. in Naval Architecture & Marine Engineering, BUET.

## Expertise

Microsoft Office, ANSYS, ABAQUS, MATLAB, Python.

## Experience

• Technical Content Writing
• Design of a cargo carrier of 2200 ton payload capacity in the Inland shipping route

## Excel Funnel Chart

In this article, we are going to see how we can create a funnel chart in Excel. The funnel chart is a very good visual aid that helps us visualize the data ...

## Issues with VLOOKUP

In this article, we are going to see how we can resolve the issues with VLOOKUP in the most efficient manner possible. Being one of the most popular lookup ...

## How to Use Excel VBA Textbox Events

In Microsoft Excel, the TextBox control is a powerful feature that facilitates seamless text and numeric data entry, enhancing user interaction within ...

## How to use the Excel VBA Watch Window

Below, you can see how the watch window monitors the variable value in Excel VBA. How to Add a Watch WindowÂ  Open the VBA code editor window. ...

## VBA Excel to Exit Do While Loop (4 Suitable Examples)

Do While conditional loop in Excel works like almost If conditional Statement, with a bit more flexibility. For example, the if condition inside the Do While ...

## How to Use Excel VBA to Filter a Pivot Table (5 Examples)

Method 1 - Filter a Pivot Table Based on Single Criteria Using VBA STEPS: To create a pivot table, a sample code is given below. The ...

## Excel VBA Call Sub from Another Module

Method 1 - Using Call Function Using the Call Function we can call a sub and execute the task inside the sub directly. There are three ...

## Excel Assign Macro to Button (3 Suitable Examples)

To demonstrate how to assign a macro to a button, we'll use a simple dataset containing student information. We'll sort this data according to the age of the ...

## How to Use the Intersection Operator in Excel – 5 Examples

What Is the Intersection Operator in Excel? The intersection operator in Excel is represented by a single space character and is used to return the common ...

## Excel VBA 2 Dimensional Array Initialization

We can obviously initialize various types of two-dimensional arrays in Excel, not to mention our selection can be expanded up to three dimensions too. ...

## Excel VBA: Input Box with Options

The Basic Syntax of an Input Box in Excel VBA The basic Syntax of an inputbox is given below: InputBox(Prompt, Title, Default, XPos, YPos, HelpFile, ...

## How to Use VBA Methods in Excel to Wait Milliseconds between Code Execution (3 Ways)

How to Launch VBA Editor in Excel You can easily launch the VBA editor by pressing Alt+F11 or using the Visual Basic command from the Developer tab. ...

## Excel VBA: Using the If, IsError, and VLookup Functions – 3 Examples

Â Syntax of the If, IsError, and VLookup Functions in VBA The syntax of the If function is: If (condition) Then ' code to execute if condition is ...

## How to Do Linear Programming with Sensitivity Analysis in Excel – 4 Steps

Linear programming is used to determine the optimal value that satisfies all the constraints and conditions specified by the problems. Excel provides a ...

Browsing All Comments By: Rubayed Razib Suprov
Rubayed Razib Suprov Aug 8, 2022 at 12:38 PM

Thanks for your question. Actually, you can approach this problem in two separate ways. One is directly calculating the significant value or using a chart. For the chart, you need to calculate the T value first, and then you will calculate the p-value. Using them, you can calculate the critical value from a chart available online.
1. The formula for calculating the T value is, t=r_sÃ—âˆš((n-2)/(1-r_s^2 ))
Where r_s is the Spearman correlation value.
n is the no of entry
The Excel formula would be in our case =E17*SQRT((E16-2)/(1-E17^2))
2. The formula for significant value, p =T.DIST.2T(ABS(calculated t value),n-2)
3. To calculate the critical value, you need to have a critical value chart. Using the p-value and the n (Number of entries), from the chart, you need to get the critical value.

4. You may be needed to interpolate the critical values as you may not have the exact p or n values. If your correlation value>critical value, then there is a significant correlation between the values. In other words, the correlation result is significant.

Rubayed Razib Suprov Aug 14, 2022 at 11:44 AM

Thanks for your question in our platform.
You may opt for the first method mentioned here to prevent Excel sheet content to another workbook completely.
Or you can read the article(https://www.exceldemy.com/protect-excel-sheet-from-copy-paste/#1_Use_Info_Option_to_Protect_Excel_Sheet_from_Copy-Paste) to prevent the workbook content from being copied to another workbook. You can ignore the VBA coding method if you want.

Rubayed Razib Suprov Aug 14, 2022 at 1:13 PM

Use the following formula =IFERROR(VLOOKUP(B5,D5:E9,2,FALSE),””)
Your given sample table is stored in column B: D. And this VLOOKUP function will look for the value of cell B5(table 1) in the first column on table 2, and then using that position, will return the meter reading from the E column. And it will return blank if there isn’t any meter reading.

Rubayed Razib Suprov Oct 2, 2022 at 12:41 PM

The RAND function is supposed to return only a random value, which is used for shuffling the dataset values. In this case, we are trying to swap cell values within two separate cells. This means your statement is not applicable. If you insist that it is possible, please write down the process or send us your Excel file through email. Thank you.

Rubayed Razib Suprov Jul 24, 2023 at 1:09 PM

Greetings Gin Got,
Sorry for the issue that you are facing. Unfortunately, the issue of 255 characters in a single cell is a fundamental feature in the Excel environment. But on the other hand, the character limit in a formula is infinite. So I suggest you stick to this articleâ€™s first or second method.
Now coming to the 4th method in which you are not getting so much success, is that this method is only for Users of Excel 2007-Excel 2013 in a very specific area. Users who are getting trouble importing data to the Myssql server are experiencing this issue of getting characters truncated in the cell. This 4th method is the solution for that reason. The article will now be updated with a note with this disclaimer. If you need further assistance then please feel free to contact us again, attaching necessary files is recommended.

Rubayed Razib

Rubayed Razib Suprov Jul 18, 2023 at 1:53 PM

You an find the solution in the below comment of yours. I have provided a reply with a code and explanation image.

Rubayed Razib Suprov Jul 18, 2023 at 1:37 PM

Greetings Valerie,
Sorry to hear about your inconvenience. Actually from our side, we are not facing issues while moving the rows. It is working quite well. If you are incorporating this code with another code there might be an issue in the parent dataset or in the sheet name. It will be much easier for us to assist you if you can provide us with your sample code, doing so we can have a look inside the code and try to identify the issue.
Still for your convenience, we are attaching another code, you can take a look and try y yourself. You need to change the sheets name(source and the destination) and the search value alongside the seourcerange(in which column you want to search the values).

``````
Sub MoveRowsByValue()
Dim sourceSheet As Worksheet
Dim destinationSheet As Worksheet
Dim sourceRange As Range
Dim destinationRow As Long
Dim searchValue As Variant
Dim lastRow As Long
Dim cell As Range
Set sourceSheet = ThisWorkbook.Worksheets("VBA delete original")
Set destinationSheet = ThisWorkbook.Worksheets("Sheet1")
Set sourceRange = sourceSheet.Range("C:C")
searchValue = "Cable"
lastRow = sourceSheet.Cells(sourceSheet.Rows.Count, sourceRange.Column).End(xlUp).Row
destinationRow = 1
For Each cell In sourceRange.Cells
If cell.Value = searchValue Then
sourceSheet.Rows(cell.Row).Copy Destination:=destinationSheet.Rows(destinationRow)
destinationRow = destinationRow + 1
End If
If cell.Row = lastRow Then Exit For
Next cell
Application.CutCopyMode = False
destinationSheet.UsedRange.Columns.AutoFit
MsgBox "Rows moved successfully!"
End Sub``````
Rubayed Razib Suprov Jul 18, 2023 at 12:58 PM

Greetings Chalon,
Below I am going to provide a code using which you will be able to move only the rows that have value in the corresponding cells in a specific column. The sheet name here termed as “Destination” and the sheet from where we want to move the cell are named as “Source”. After putting the code in the code editor, press the Run command buton.

``````
Sub MoveRowsBasedOnValue()
Dim sourceSheet As Worksheet
Dim destinationSheet As Worksheet
Dim sourceRange As Range
Dim cell As Range
Dim destinationRow As Long
Set sourceSheet = ThisWorkbook.Worksheets("Move Row") ' Replace "Sheet1" with your actual sheet name
Set destinationSheet = ThisWorkbook.Worksheets("Destination") ' Replace "Sheet2" with your actual sheet name
Set sourceRange = sourceSheet.Range("D5:D10") ' Replace "D5:D10" with your actual range
destinationRow = 1
For Each cell In sourceRange
If Not IsEmpty(cell) Then
sourceSheet.Rows(cell.Row).Copy Destination:=destinationSheet.Rows(destinationRow)
destinationRow = destinationRow + 1
End If
Next cell
Application.CutCopyMode = False
destinationSheet.UsedRange.Columns.AutoFit
MsgBox "Rows moved successfully!"
End Sub``````

After running the code,we will see that the rows corresponding to the cell values are now mooved to the destination sheet.

Rubayed Razib Suprov Jun 15, 2023 at 1:04 PM

Greetings Vinod,

The code provided above is actually working quite well for multiple members of our team. The Error you experienced is local and I advise you to review the code and check whether you made any altercation to the code. Try to paste the code as given here same to the editor. Just change the attachment address according to your need.

The specific error that you are experiencing might be the cause of using the same variable k in multiple places. Again, in our code, we did not use the variable in multiple places in the same code. Try to paste the same code that we provided or change the variable name to something else, like K1. Hope this helps.

Thanks and Regards
Rubayed Razib
Team Exceldemy

Rubayed Razib Suprov May 28, 2023 at 5:15 PM

Greetings Prasanth,
Thanks a lot for the question you asked. Below I provide a code using which you can add rows in another worksheet. When you run the code, then you will see that the values stored in the C3:D3 insert in another worksheet. The values are now repeated according to the value mentioned in the cell E3

``````
Sub InsertRows()
Dim Qty As Integer
Dim sourceSheet As Worksheet
Dim destinationSheet As Worksheet
Dim lastRow As Long
Dim pasteRange As Range

Set sourceSheet = ThisWorkbook.Worksheets("Sheet1") ' Replace "Sheet1" with the actual name of the source sheet
Set destinationSheet = ThisWorkbook.Worksheets("Sheet2") ' Replace "Sheet2" with the actual name of the destination sheet

Qty = sourceSheet.Range("E3").Value

lastRow = destinationSheet.Cells(destinationSheet.Rows.Count, "B").End(xlUp).Row

Set pasteRange = destinationSheet.Cells(lastRow + 1, "B").Resize(Qty, 2)

pasteRange.Insert Shift:=xlDown

destinationSheet.Cells(lastRow + 1, "B").Resize(Qty, 2).Value = sourceSheet.Range("C3:D3").Value

Application.CutCopyMode = False
destinationSheet.Select ' Optional: Select the destination sheet after inserting rows
End Sub
``````
Rubayed Razib Suprov May 28, 2023 at 5:12 PM

Greetings Edward,
Thanks a lot for your Question in our blog post. Now the issue you have is a little bit unclear to me. Can you provide a sample output manually which will contain your desired result? In that way, your problem be more clear to us and in turn it will help us to resolve your problem.

Rubayed Razib Suprov May 28, 2023 at 2:00 PM

Greetings Prasanth,
Thanks a lot for your question. You can follow the modified code given below to insert rows to another sheet.Here the input tanges are in the Sheet1 and the Output ranges where the rows are going to be inserted Sheet2.

``````
Sub InsertRows()
Dim Qty As Integer
Dim sourceSheet As Worksheet
Dim destinationSheet As Worksheet
Dim lastRow As Long
Dim pasteRange As Range

Set sourceSheet = ThisWorkbook.Worksheets("Sheet1") ' Replace "Sheet1" with the actual name of the source sheet
Set destinationSheet = ThisWorkbook.Worksheets("Sheet2") ' Replace "Sheet2" with the actual name of the destination sheet

Qty = sourceSheet.Range("E3").Value

lastRow = destinationSheet.Cells(destinationSheet.Rows.Count, "B").End(xlUp).Row

Set pasteRange = destinationSheet.Cells(lastRow + 1, "B").Resize(Qty, 2)

pasteRange.Insert Shift:=xlDown

destinationSheet.Cells(lastRow + 1, "B").Resize(Qty, 2).Value = sourceSheet.Range("C3:D3").Value

Application.CutCopyMode = False
destinationSheet.Select ' Optional: Select the destination sheet after inserting rows
End Sub
``````
Rubayed Razib Suprov May 10, 2023 at 10:56 AM

Greetings Pooja,
You might want to know how you can attach a whole dataset to the worksheet. For this, you can follow this article from our website. In this article, you will know how you can attach values to the worksheet from the inputbox values. If your query is related to something else, please elaborate on your problem with examples.

Rubayed Razib Suprov May 7, 2023 at 11:34 AM

Greetings Beck,
Thanks a lot for your question. I am not entirely sure if your question is pertinent to topic of the this article, or if it is just a standalone question. I am giving you a response treating the question as a standalone question.
To have different values in the cell which is 10 digits long and starts with 430, paste the below code in the code editor, and then press Run.

``````
Sub generate_numbers()
Dim i As Long
Dim myrange As Range
Set myrange = Range("B3:B12")
For i = 1 To myrange.Cells.Count
myrange.Cells(i) = "430" & Format(i, "0000000000")
Next i
End Sub
``````

After pressing Run, you will notice that the code now put 10 distinct 10-digit values in the worksheet starting with 430.
Hope this helps, if you have any other question or suggestions,please do not hesitate to comment on this post.

Rubayed Razib Suprov Apr 10, 2023 at 1:13 AM

Greetings,
I understand your query. You asked about attendence sheet for both monthly and weekly basis. But my suggestion will be to go on with the monthly basis assesment. In this way your job will be much smoother. Secondly I provided a demo sheet that actually contains the attendence with time picker drop down, and summation of total hour of work in a month.The time picker need to have a fixed time and they are specified below the sheet.You just need to enter the month and year in the beginning and then you can enter the in time and out time using the time picker.

assign Rubayed Razib Suprov Feb 16, 2023 at 4:39 PM

Thanks a lot for posting your query in Exceldemy
Below I am giving you a VBA code using which you can open the outlook template saved on your pc and then replace them with desired text from the Excel sheet.

``````
Sub EmailClient()
Dim OutApp As Object
Dim OutMail As Object
Dim strbody As String
Dim clientName As String

' Get the client's email address from the selected cell
Dim email As String
email = Selection.Value

' Get the client's name from the first column of the selected row
clientName = Cells(Selection.Row, 1).Value

' Create the email body using your Outlook template
' Replace "TemplateName" with the name of your Outlook template
Set OutApp = CreateObject("Outlook.Application")
Set OutMail = OutApp.CreateItemFromTemplate("C:\Users\user\Documents\OutlookTemplate.oft")

' Replace "Client Name" with the name of your client field in the template
strbody = Replace(OutMail.HTMLBody, "Name", clientName)
OutMail.HTMLBody = strbody

' Set the recipient email address
OutMail.To = email

' Display the email and let the user edit it before sending
OutMail.Display

' Clean up
Set OutMail = Nothing
Set OutApp = Nothing
End Sub
``````

the sample template file that we are using is given below.
The Name, in the beginning, is going to be replaced by the desired name and the recipient will be the selected mail address.

In the code, two separate things must be taken seriously, firstly the location of the template file. The location of the template mail has to be specified correctly in the code(Marked as 1), as shown in the image. So please rewrite the location of the file correctly.
secondly, f you need to specify which term to replace with names inside the code(Marked as 2).

the location of the template file in your pc can be found in the properties tab as shown below.

finally, you are ready to execute the code.For this, you have to first select the email address to which you want to send the email. Then Run the Macro by pressing the Macro button placed just right side of the information.

Then you can see that the a new email has been composed with the name placed in the beginning with the selected mail address as the recipient.

Regards,
Rubayed Razib

Rubayed Razib Suprov Feb 16, 2023 at 3:34 PM

Thanks a lot Salih, for your query

I think I understood your problem. Here, your cant put the table name in this way. You have to insert the table name in between two apostrophe symbol. So basically your code line should be like
Set t = x.ListObjects(“Depart_Filter5”)

Rubayed Razib Suprov Feb 16, 2023 at 3:13 PM

Thanks a lot for your response John,
Here there might be some other issues underlying your file that is causing issue for you. It would be better if your share your file with us and we can have a look into it.

Rubayed Razib Suprov Feb 16, 2023 at 2:50 PM

Thanks a lot for your appreciation.

Rubayed Razib Suprov Jan 29, 2023 at 10:57 AM

Greetings TRISH,

In your case, it is difficult to ans this problem without having a look at your worksheet . Please send the worksheet to our problem solving, hence we can assist you on this issue.

Rubayed Razib Suprov Jan 26, 2023 at 4:47 PM

Greetings Debbie,

First of all,we really appreciate for your question. Now if I am not afraid, you asked about why your total percentage value not changed despite deleting one sample value. If this is the case, the reason is pretty simple. as you delete one value, your total value also change. Which in turns also change the percentage value of all the other values. and this change will happen in a way that the total percentage values are always sums up to 100, following the basic arithmatic rule.
If this is not the case,please provide your Excel worksheet containing your data and we will have a look.

Thanks and Regards
Rubayed Razib

Rubayed Razib Suprov Jan 26, 2023 at 1:58 PM

Greetings Rob,
Thanks a lot for commenting on this article. Unfortunately, we managed to find only the last three companies and the INVESTEC CORE FUND IWCF among the companies you metioned in the database. Rest of them are not enlisted in the database. I have given the dataset link containing the stock informations of the Satrix RESI ETF SATRIXRESI, Coronation Global Capital Plus [ZAR] Feeder CPLSZ, Ninety One Equity Fund NINEQ, INVESTEC CORE FUND IWCF etc.

Thanks and Regards
Rubayed Razib

Rubayed Razib Suprov Dec 26, 2022 at 2:39 PM

Thanks a lot for providing the correction. Both the Image and the Formula has been updated.

Rubayed Razib Suprov Dec 26, 2022 at 1:36 PM

Hello Amghar,
Thanks a lot for submitting Excel related problem at Exceldemy. Here you can use the VBA code mentioned below.

``````Sub Detect_font_color()
If Worksheets("Sheet1").Range("D6").Font.ColorIndex = 6 Then
Range("D6").RowHeight = 20
End If
End Sub
``````

In that code, you need to mention the cell address inside the VBA code range property(as shown in the image). After this, if the condition satisfied, the cell row height will adjust accordingly.

Rubayed Razib Suprov Dec 26, 2022 at 1:10 PM

Thanks a lot for submitting question in Exceldemy. From our end, every single method is actually working perfectly. Could you please specify which method you are experiencing this error with? Did you test with the dataset provided here? If not, could you please send us the Excel files?

Rubayed Razib Suprov Sep 4, 2022 at 1:03 PM

Thanks a lot for your compliments, Raul. Glad to hear that the article came in handy for you

Rubayed Razib Suprov Aug 30, 2022 at 10:27 AM

Thanks a lot for your comment, we will take your suggestions into consideration in the future.

Rubayed Razib Suprov Aug 30, 2022 at 10:22 AM

Thanks for your question. Here Seattle has a rating of -0.50409…And St Louis Rams has -4.439784. if you subtract -0.50409 from the -4.439784, then you will get 4.943874.which is approximately around 4. So the statement that “Seattle has 4 points better than St Louis”

Rubayed Razib Suprov Aug 30, 2022 at 10:05 AM

Thanks a lot for your appreciation.

Rubayed Razib Suprov Aug 30, 2022 at 10:04 AM

Thanks a lot for your question. In the screenshot, all of the P values are actually below 0.05. One value is 0.002384973 and another one is 1.4769*10^-10. Maybe you got a little confused as the letter E is hard to notice. Hope this helps.

Rubayed Razib Suprov Aug 21, 2022 at 1:10 PM

Thanks for your question, Jorge F. The allocation of memory mostly depends upon the dataset in which you are working on, and how they are interacting to other functions. For example, if you use a nested function, that function will cost more memory. There are some functions out there that consume more memory compared to other functions. Among the methods described above, the SUMPRODUCT function has more memory allocation compared to other functions. The other two methods would consume more or less the same amount of memory.

Rubayed Razib Suprov Aug 21, 2022 at 11:49 AM

Thanks a lot for your question, Aaron. Here we are going to use a separate formula for highlighting the entire row based on whether any of the values in the row are blank or not. Notice the image below, we got blank cell in C8,C11, and C14

2. First, go to the Conditional Formatting, and set the rules as shown below.

3. Then select only the B4:D4, and copy the formatting style of this cell.

4. Paste the formatting style all over the range of B4:D15.

And now you can see that the rows now highlighted if there is any blank cell in the entire row.

Rubayed Razib Suprov Aug 21, 2022 at 11:10 AM

Thanks a lot for your question. Here, if all of the cells on a single row are blank in your dataset, they will be highlighted if you follow this tutorial. If you have any further issues, feel free to inform us again.

Rubayed Razib Suprov Aug 14, 2022 at 1:38 PM

Thanks for your question James, I am not quite sure in which step you get the first error. You can better opt for an alternative approach.
1. The procedure above should be followed until the first extension change. After the extension is changed to .zip, use the 7-zip application to open the archive, not to extract the zip.

2. Then inside the archive, go to xl>worksheet. and double click on the sheet1.xml to edit the text as mentioned in the post.

3. you can use a regular notepad application for opening the XML file. Or you can also opt for an XML notepad(https://microsoft.github.io/XmlNotepad/##_top) instead of a regular notepad. using the XML notepad, you can delete the protection part directly as a folder, as shown in the image.

4. After deleting the protection part, save the XML file.
5. And then change the extension part back to xls.
6. You will see that the Excel file is now unprotected.
Last but not the least, try to use Microsoft Office 365 instead of regular version of Excel.That way you will always be ensured with the latest updates.

Advanced Excel Exercises with Solutions PDF