Public Schedule Face-to-Face & Online Instructor-Led Training - View dates & book

STL - Formerly Best Training Solutions Through Learning
TrustPilot
Excellent
Request Callback We will call you back
0207 987 3777 Call for assistance
Your Basket Basket is empty
data table

ResolvedVersion Standard

josephine has attended:
Excel Intermediate course

Data in table

can you automatically insert a blank line in between each row of data in table

Inserting blank rows between data in table

Hi Josephine

As I explained yesterday this would need some VBA code. So do the following steps:

1. Open the Workbook in which you need to insert the rows.

2. Open the Tools menu Select Macro and Click the Visual Basic Editor (VBE)

3. In the VBE Open the Insert menu and Click Module. This inserts a new Module.

4. Copy the following code and paste into the new module (Module1)


Sub InsertBlankRows()

'Select last row in worksheet.
Selection.End(xlDown).Select

Do Until ActiveCell.Row = 1

'Insert a blank row
ActiveCell.EntireRow.Insert Shift:=xlDown

'Move up one row.
ActiveCell.Offset(-1, 0).Select

Loop

End Sub


5. Close the VBE.

Back in the workbook

6. Click the first cell of the first row of the table eg A1

NB Ensure that there are no blank cells in this column as the system will not do anything past this

7. Open the Tools menu Select Macro and Click Macros

8. In the Macro dialog box Select the InsertBlankRows macro and click Run

The system will insert a blank row between each record

Hope this helps

Carlos

Excel tip:

Formula for last day of month

In some cases it is necessary to find the last day of a month for a given date. If you use the following formula, you can achieve this, ie; if you have a column of dates, use this formula to find the end of month for each day by using the fill handle. The formula is as follows, and assumes in this example that the first date in question is in cell C5, in any other cell type; =DATE(YEAR(C5),MONTH(C5)+1,1)-1

View all Excel hints and tips

Connect with us:

0207 987 3777

Call for assistance

Request Callback

We will call you back

Server loaded in 0.1 secs.