0

I'm trying to setup a spreadsheet where Columns A to D remain Static. I'd like to create a setup where a user can type a number into a cell and click a button.

The button would insert that many number of rows but starting at say D2, effectively moving everything down by the user defined number but not shifting down anything located in columns A-D

I'm quite new at macros and have been trying to recreate this by recording myself, but I am struggling at getting the script to add rows without affecting the predefined area (columns A-D)

  • I have to apologize for my poor English skill. Unfortunately, I cannot understand your question. In order to correctly understand your question, can you provide your current script, the sample input and output situations you expect? First, I would like to correctly understand your question. – Tanaike Jul 27 '23 at 02:26
  • Apologies for not being clear. I guess what I would basically like to try to do is create a macro that allows me to add new rows while keeping Columns A to D Static. So the new rows would only be added starting from Column E onwards – Ernest Cheung Jul 27 '23 at 02:29
  • Thank you for replying. I would like to support you. But, I have to apologize for my poor English skill, again. Unfortunately, from your reply, I cannot still understand your question. But I would like to try to understand it. When I could correctly understand it, I would like to think of a solution. I would be grateful if you can forgive my poor English skill. – Tanaike Jul 27 '23 at 02:31
  • Is there a way to use InsertRowsBefore but only affect Columns E and onward? So it would lock Columns ABCD, adding a new row would effectively push everything down from Columns E onwards – Ernest Cheung Jul 27 '23 at 03:22
  • 1
    Per @Tanaike's comment: [edit] your question and **"provide your current script"** that isn't working. Comments may request clarification, but any relevant information should be in your question. Consider taking the site [Tour] and also review [ask]. – Blind Spots Jul 27 '23 at 14:44
  • it seems what is wanted is to insert cells in (a range of) columns, not insert rows. – Mr Shane Jul 29 '23 at 21:30
  • Does this answer your question? [How to insert several cells (not an entire row/column) using google script?](https://stackoverflow.com/questions/59285779/how-to-insert-several-cells-not-an-entire-row-column-using-google-script) – Mr Shane Jul 29 '23 at 21:40

0 Answers0