+ Reply to Thread
Results 1 to 8 of 8

VBA code to add a row based on a cell value

  1. #1
    Registered User
    Join Date
    11-07-2017
    Location
    Somerset
    MS-Off Ver
    Office 2016
    Posts
    2

    VBA code to add a row based on a cell value

    Hello,

    I've a very large excel spreadsheet and I'd like to add a new row above a value in a coloumn using VB code

    The value is "1" in column "B" and the the new row is to be inserted everytime the value "1" appears in that coloumn.

    Thanks

  2. #2
    Forum Moderator davesexcel's Avatar
    Join Date
    02-19-2006
    Location
    Regina
    MS-Off Ver
    MS 365
    Posts
    13,481

    Re: VBA code to add a row based on a cell value

    Loop from the bottom
    Please Login or Register  to view this content.

  3. #3
    Forum Expert
    Join Date
    11-27-2007
    Location
    New Jersey, USA
    MS-Off Ver
    2013
    Posts
    1,669

    Re: VBA code to add a row based on a cell value

    HTML Code: 

  4. #4
    Forum Expert
    Join Date
    11-27-2007
    Location
    New Jersey, USA
    MS-Off Ver
    2013
    Posts
    1,669

    Re: VBA code to add a row based on a cell value

    sorry, didn't see prv reply. didn't mean to duplicate.

  5. #5
    Forum Expert
    Join Date
    10-06-2017
    Location
    drevni ruchadlo
    MS-Off Ver
    old
    Posts
    2,151

    Re: VBA code to add a row based on a cell value

    To the collection ...
    Please Login or Register  to view this content.

  6. #6
    Registered User
    Join Date
    11-07-2017
    Location
    Somerset
    MS-Off Ver
    Office 2016
    Posts
    2
    Thanks for this, I'll try this tomorrow as I've just left work
    Mr leeroy

  7. #7
    Forum Moderator davesexcel's Avatar
    Join Date
    02-19-2006
    Location
    Regina
    MS-Off Ver
    MS 365
    Posts
    13,481

    Re: VBA code to add a row based on a cell value

    Quote Originally Posted by porucha vevrku View Post
    To the collection ... ............
    Nice one, should be mentioned the code only works as long as Column A is filled in.

  8. #8
    Forum Expert
    Join Date
    10-06-2017
    Location
    drevni ruchadlo
    MS-Off Ver
    old
    Posts
    2,151

    Re: VBA code to add a row based on a cell value

    Nothing and nobody is perfect ...

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. [SOLVED] Help with VB code to return the value of a cell based on the Active Cell selection
    By rv02 in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 09-19-2016, 10:16 AM
  2. [SOLVED] VBA code to lock cell based on anotehr cell value not working
    By michelle 1 in forum Excel Programming / VBA / Macros
    Replies: 11
    Last Post: 08-29-2016, 12:09 PM
  3. Replies: 1
    Last Post: 05-11-2015, 06:02 PM
  4. VBA code to format cell into date based on number entered into cell
    By b624333 in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 07-02-2014, 08:16 PM
  5. VBA Code to Make a Cell Value Negative Based on Content of Adjacent Cell
    By Court Manager in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 04-08-2014, 04:18 PM
  6. Replies: 5
    Last Post: 12-07-2013, 02:21 PM
  7. Excel VBA Code for locking/unlocking a cell based on the value of another cell
    By latourjim in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 05-22-2013, 10:03 PM

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