Results 1 to 9 of 9

Macro for inserting multiple rows with Formulae and formating

Threaded View

  1. #1
    Registered User
    Join Date
    09-05-2012
    Location
    Bangalore
    MS-Off Ver
    Excel 2007
    Posts
    7

    Macro for inserting multiple rows with Formulae and formating

    Hello

    I am Sreeraj and I am in need of help.

    I am developing an excel sheet for my colleagues.

    This sheet will be a dynamic sheet and my colleagues will need to keep on adding data to this file. This data may not use more than 700 rows.

    I need a macro that
    will identify the first blank cell in Column A
    As for the number of rows to be inserted and
    Copy the formulas and formating of the Row above the first blank cell and paste it in the number of rows defined.

    I have a macro (thanks to google) that will identify the first blank cell in Column A and then copy the Row above the first blank cell and paste it once (both the formating and formulae).

    It is given below

    Sub Insert_Rows()
    Range("A1:A1000").Select
    Do Until ActiveCell.Value = "" = True
    ActiveCell.Select
    If ActiveCell.Value = "" = False Then
    Selection.Offset(1, 0).Select
    Else
    End If
    Loop
    Application.ScreenUpdating = False
    Dim cell As Range
    Selection.EntireRow.Insert
    For Each cell In Intersect(ActiveSheet.UsedRange, Selection.Offset(-1, 0).EntireRow)
    If cell.HasFormula Then
    cell.Copy cell.Offset(1, 0)
    End If
    Next
    Application.ScreenUpdating = True
    End Sub
    I hope some one can help me with this.

    Regards

    Sreeraj
    Last edited by Cutter; 09-07-2012 at 03:51 PM. Reason: Added code tags

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1