+ Reply to Thread
Results 1 to 6 of 6

Change/replace vb code .EntireRow.Insert (2007)

  1. #1
    Forum Contributor
    Join Date
    03-29-2012
    Location
    Canada
    MS-Off Ver
    2007
    Posts
    818

    Change/replace vb code .EntireRow.Insert (2007)

    Good evening,
    I would need help replacing a code I have. The code is doing the following:
    Every time I add a number in column B the code runs the following:
    Copy what is in column A and adds it to column C but also copies it to how many rows was inserted in Column B. Therefore if 002 is added to column B then it will insert the numbers of row then add the number:

    Ex:
    If:
    Column A = Test
    Column B = 002

    Then
    Column C = Test/001/HS

    Then
    Column A (next row) = Test
    Column B (next row) = 002
    Column C (next row) = Test/002/HS

    Here is the code:

    Please Login or Register  to view this content.
    The code is “.EntireRow.Insert” but I just need it to be added but not as a “.EntireRow.Insert”.
    Could someone help me with the changes?

    Please Help.

    Thank you in advanced,

    ExcelNoub

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

    Re: Change/replace vb code .EntireRow.Insert (2007)

    attach a sample file with current and desired table
    If solved remember to mark Thread as solved

  3. #3
    Forum Contributor
    Join Date
    03-29-2012
    Location
    Canada
    MS-Off Ver
    2007
    Posts
    818

    Re: Change/replace vb code .EntireRow.Insert (2007)

    Here is a test sheet

    Test.xlsm

    I have not inserted the code in sheet2. Initial code is in Sheet1.

    The restriction should be in between row 5 and 30. If 002 is inserted in Column B then it will add one row. That I dont need. I need it just to add the information.

  4. #4
    Forum Guru HaHoBe's Avatar
    Join Date
    02-19-2005
    Location
    Hamburg, Germany
    MS-Off Ver
    work: 2016 on Win10 (notebook), private: 2019 on Win10 (desktop), 2019 on Win11 (notebook)
    Posts
    8,197

    Re: Change/replace vb code .EntireRow.Insert (2007)

    Hi, Excelnoub,

    try it like this (I just commented the passages out, you only need to check the Intersect once):

    Please Login or Register  to view this content.
    Ciao,
    Holger
    Use Code-Tags for showing your code: [code] Your Code here [/code]
    Please mark your question Solved if there has been offered a solution that works fine for you

  5. #5
    Forum Contributor
    Join Date
    03-29-2012
    Location
    Canada
    MS-Off Ver
    2007
    Posts
    818

    Re: Change/replace vb code .EntireRow.Insert (2007)

    Will try this tomorrow and let you know,

    Thank you HaHoBe

  6. #6
    Forum Contributor
    Join Date
    03-29-2012
    Location
    Canada
    MS-Off Ver
    2007
    Posts
    818

    Re: Change/replace vb code .EntireRow.Insert (2007)

    Works like a charm,

    This simple I need more coffee...

    Thank you HaHoBe

+ Reply to Thread

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