Results 1 to 7 of 7

Macro that Inserts a row in between rows (with formulas etc)

Threaded View

  1. #1
    Registered User
    Join Date
    06-25-2011
    Location
    Scotland
    MS-Off Ver
    Excel 2019 / 365
    Posts
    71

    Macro that Inserts a row in between rows (with formulas etc)

    Hi,
    I’m new to VBA & struggling a bit…..to explain…..I have 2 worksheets (“Main Log” & “Summary Log”) In the code below it inserts a row where I want it including formulas etc which is good…..but…
    1. Is there a code that would insert in the “Main log” & “Summary log” (P.s I need the row in exact same row number but it has different formulas in it)?
    2. Is there another code to delete the entire row on both sheets also?
    3. Can I get round having the Summary log sheet locked?

    #
    Sub Test()
    Dim r
    r = Application.InputBox(Prompt:="Enter row number", Title:="Insert row", Default:=ActiveCell.Row, Type:=1)
    If r = False Then Exit Sub
    Rows(r - 1).Copy
    Rows(r).Insert
    On Error Resume Next
    Rows(r).SpecialCells(xlCellTypeConstants).ClearContents
    End Sub
    #
    Last edited by How How; 02-13-2013 at 08:07 AM.

Thread Information

Users Browsing this Thread

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

Tags for this Thread

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