+ Reply to Thread
Results 1 to 5 of 5

Inserting Rows based on a cell value and populating them.

  1. #1
    Registered User
    Join Date
    12-21-2012
    Location
    Western New York State
    MS-Off Ver
    Excel 2007
    Posts
    3

    Inserting Rows based on a cell value and populating them.

    Hello and PLEASE HELP!!!

    I would like to insert a number of rows x (the value in cell B32), directly below row Row 32. I want Column A to read "Enter the name of Room #(1,2,3...x)" In Column B I want it to say "Room (1,2,3....x). This is all on the same sheet.

    After this is working on operator will input values into column C. Then I will want to insert rows on another page based on the operators input. BUT one step at a time. I'm okay at excel, but not so good at Macros.

    Thanks you for your help!!

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

    Re: Inserting Rows based on a cell value and populating them.

    Hi, Cleanroomservices,

    maybe this will help with the first part of your problem:
    Please Login or Register  to view this content.
    The second problem could be solved by using the Worksheet_Change-Event being limited to just entries in Column C.

    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

  3. #3
    Registered User
    Join Date
    12-21-2012
    Location
    Western New York State
    MS-Off Ver
    Excel 2007
    Posts
    3

    Re: Inserting Rows based on a cell value and populating them.

    Thanks HaHoBe!!!

    First the routine worked well!!!! However I must have been slightly unclear in the auto fill portion. What I was looking for was to have the a column say "Enter the name of Room #1", the next row would say "Enter the Name of Room #2", followed by "Enter the name of Room #3", And so forth until all of the new rows (based on the value in cell B32) are full. Column B would be similar, except it would be Room #1, Room #2, Room #3 and so forth. Is this possible???

    Secondly, I also have no idea what a worksheet change event command is or where/how to use it. When I get to this stage of the project, there will be some simple column formulations that will need to be adjusted as the number of rows change. Need to fix the auto fill portion first!!!!

    Thanks again for your help!!

  4. #4
    Registered User
    Join Date
    12-21-2012
    Location
    Western New York State
    MS-Off Ver
    Excel 2007
    Posts
    3

    Re: Inserting Rows based on a cell value and populating them.

    Oh...just noticed this too....

    When I change the value in B32, it pushes data to the right. I need to have all of the data deleted, even if the value will be smaller.

    Thanks again!!

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

    Re: Inserting Rows based on a cell value and populating them.

    Hi, Cleanroomservices,

    letīs take things one step at a time.

    The range in Columns A to C will be deleted below Row 32:
    Please Login or Register  to view this content.
    The Worksheet_Change-Event will be triggered when you enter a value into any cell in a worksheet. That may interfere with deleting and writing to cells so the event should be disabled before the deleting and writing and be enablled thereafter.

    Ciao,
    Holger

+ 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