0

0

## How to Generate a Word Document from an Excel Macro

While working in Excel, we often need to generate a word document from Macro to copy our valuable data from the Excel worksheet to the word file. In this ...

0

## How to Apply Macro to Convert Multiple Excel Files to CSV Files

One of the common problems that most of us face in our daily lives while working with Macro in Excel is how to convert multiple Excel files to CSV files. In ...

0

## How to Extract Specific Data from PDF to Excel Using VBA

One of the common problems that most of us face in our daily lives is how to extract some specific data from a PDF file to an Excel worksheet using VBA. In ...

0

## Excel VBA: Pull Data Automatically from a Website (2 Methods)

An important task that most developers encounter while working with Excel VBA or any other programming language is to pull data automatically from a website. ...

0

## How to Split Date and Time Using VBA in Excel (2 Easy Methods)

In this article, Iâ€™ll show you how you split date and time using VBA in Excel. Excel VBA: Split Date and Time (Quick View) Sub Split_Date_and_Time() ...

0

## Excel VBA: Split String by Number of Characters (2 Easy Methods)

In this article, Iâ€™ll show you how you split a string by any given number of characters using VBA in Excel. Split String by Number of Characters with ...

0

0

## Excel VBA: Set Range by Row and Column Number (3 Examples)

In this article, Iâ€™ll show you how you can set a range by using the row number and the column number in VBA in Excel. Excel VBA: Set Range by Row and ...

0

## Excel VBA: Remove Duplicates from an Array (2 Examples)

Many a time while working with VBA in Excel, we need to remove the duplicates from an array. In this article, Iâ€™ll show you how you can remove duplicates from ...

0

## How to Generate Random Number in a Range with Excel VBA

Not only in Excel VBA but also while working with almost all the programming languages, we often need to generate one or more random number (s) in between a ...

0

## Excel VBA: Combined If and Or (3 Examples)

While working with VBA in Excel, we often have to use combined If and Or to carry on a task when at least one among multiple conditions is satisfied. In this ...

0

## Excel VBA: Move Column Based on Header (3 Examples)

While working with VBA in Excel, we often need to move one or more column (s) based on Header (s). In this article, Iâ€™ll show you how you can move a column ...

0

0

## How to Delete Empty Rows and Columns in Excel VBA (4 Methods)

While working with VBA in Excel, we often need to delete empty rows and columns. In this article, Iâ€™ll show you how you can delete rows and columns in Excel ...

##### Browsing All Comments By: Rifat Hassan
1. Hi Veronika, if your problem isn’t solved yet, you can send the file to my mail or can send an image of your file. I’ll try.

2. Hi Arjun, the codes are absolutely flawless and there is no reason for them to not work properly. Did you insert the inputs correctly?

3. Hi Luis,
Thank you for your response. Hope this comes in handy for more people like you.

4. Hello Sam,
Thank you Sam for your response. It’s working fine now. Thank you again.

5. Hi Mohammed, Thanks for your response. Insert the name of the text and the color code in the 2nd and 3rd lines of the codes directly.

6. Hi Man, Thanks in advance. Can you please tell me where exactly the bug is? I have run the code in every way possible and there evolves no error. I think you couldn’t enter the inputs properly. Please go through the article again and then try. If it still doesn’t work, please tell me what exactly the error is.

7. Hi Dennis,

Thanks for your response. To skip the table name, first, remove the 4th line of the code, that is, Table_Name = InputBox(“Enter the Name of the Table: “).

Then enter the name of the table within the 6th line of the code. For example, if the name of your table is “Table1”, then the line should be: Set tbl = ws.ListObjects(“Table1”).

So the complete code will be:

Dim ws As Worksheet
Set ws = ActiveSheet

Dim tbl As ListObject
Set tbl = ws.ListObjects(“Table1”)

End Sub

8. I think the problem lies in the apostrophes. Use this code instead of yours. It works fine for me.

Sub InsertRowsfromUserInput()
Dim iRow As Long
Dim iCount As Long
Dim i As Long
iCount = InputBox(Prompt:=”How Many Rows to Insert?”)
iRow = InputBox _
(Prompt:=”Where to Insert New Rows? (Enter the Row Number)”)
For i = 1 To iCount
Rows(iRow).EntireRow.Insert
Next i
End Sub

If it still doesn’t work, after pasting the code in the VBA editor, change the apostrophes of the 5th and 7th lines manually. Hope it will work then.

9. Thank you Ana. It’s difficult to give any suggestions without having a glance at the workbook. Would you please kindly share your workbook with me?