+ Reply to Thread
Results 1 to 2 of 2

Macro insert row in range ("B4:H")

Hybrid View

  1. #1
    Registered User
    Join Date
    06-06-2012
    Location
    Mexico
    MS-Off Ver
    Excel 2010
    Posts
    99

    Macro insert row in range ("B4:H")

    Hi Users of Excel Forum!, Good morning!

    I have a problem with this macro:

    With Sheets("CUSTOMIZED BOM")
      If Intersect(ActiveCell, .Range("A4:A7000")) Is Nothing Then GoTo einde
    Set R = .Columns(3).Find(ActiveCell, , xlValues, xlWhole)
     With R
      If Not .Offset(WorksheetFunction.CountIf(Columns(3), R), 2) = "C" Then
             '.Offset(WorksheetFunction.CountIf(Columns(3), R), 2).EntireRow.Insert
             
             'Range("B4").Offset(WorksheetFunction.CountIf(Columns(3), R), 2).Insert
            Range("B4").End(xlUp).Offset(WorksheetFunction.CountIf(Columns(3), R), 1).Insert
            
              .Offset(WorksheetFunction.CountIf(Columns(3), R), 2) = "C"
    I have this case:
    I select a value in A4:A range (I have other macro), I don't move the values ​​in range "A", but I need to put a Row in range ("B4:H"),

    I try with this:
    .Offset(WorksheetFunction.CountIf(Columns(3), R), 2).EntireRow.Insert
    ,
    but put me a EntireRow and move the values in "A"

    And try with this:
    Range("B4").End(xlUp).Offset(WorksheetFunction.CountIf(Columns(3), R), 1).Insert

    Someone help me?
    Best Regards!
    Last edited by feroguz; 11-21-2012 at 02:20 PM.

  2. #2
    Forum Expert
    Join Date
    07-15-2012
    Location
    Leghorn, Italy
    MS-Off Ver
    Excel 2010
    Posts
    3,431

    Re: Macro insert row in range ("B4:H")

    what do you mean with A4:A range, range ("B4:H") ? attach a sample file describing your goal
    If solved remember to mark Thread as solved

+ Reply to Thread

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