+ Reply to Thread
Results 1 to 2 of 2

VBA Script in Excel 365 to add a new row when a button is pressed

  1. #1
    Registered User
    Join Date
    11-27-2020
    Location
    Glasgow, Scotland
    MS-Off Ver
    Office365
    Posts
    1

    VBA Script in Excel 365 to add a new row when a button is pressed

    Hi

    I am creating a Excel spreadsheet specifically for PAT (Portable Appliance Testing) in the UK, this test is an electrical safety check, and depending where the equipment is is dependent on how long the PAT test is valid for - in the office it is 365 days, in the workshop it is 180 day and for the field engineers it is 60 days.

    I have the conditional formatting done, checking the dates too, but what I would like is a button which adda a row to the bottom of the table with all the formatting, formulas and conditional formatting in place.

    I have searched google with no avail, I have been able to create a new row but the formatting and formulas and contitional formatting has not copied over.

    I humbly ask for your assistance.

    Cheers

    Stuart

  2. #2
    Valued Forum Contributor Harribone's Avatar
    Join Date
    02-24-2013
    Location
    Midlands, UK
    MS-Off Ver
    Excel 2019/365
    Posts
    570

    Re: VBA Script in Excel 365 to add a new row when a button is pressed

    When you say table do you mean an Excel Table (when you click on a cell in the table a new option at the top should appear, Table Design) or is it just some data that you have put borders around?

    I am guessing its the latter and recommend you format the data as a table. To do this select the data area (including headings) and then hit Ctrl+T. Tick the 'my data has headers' box if not already then click ok.
    When you add any data underneath Excel will resize the table for you. Any columns with formulas will automatically copied down along with conditional formatting.

    It will be best to start on a blank sheet and copy paste the data in that you have (as values) an add formulas conditional formatting so that they auto populate.
    If you need help any help with creating let us know.
    Say thanks, click *

+ 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. Excel 2010 Slicers: VBA to Stop Refresh Until Command Button Pressed
    By excelforumkeys in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 09-09-2014, 08:36 PM
  2. Toggle Button on Workbook Open - value is True but button not pressed?
    By excelnat in forum Excel Programming / VBA / Macros
    Replies: 19
    Last Post: 07-03-2014, 11:23 AM
  3. Toggle Button in Ribbon Excel UI - After Reopening file it is not pressed
    By marzoumm in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 05-02-2014, 09:33 AM
  4. Redirect Excel to a Macro when the button 'Refresh All' is pressed
    By Pommy in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 04-17-2014, 11:20 AM
  5. vba code for ESC button , when pressed excel file goes to sheet1
    By KK1234 in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 07-08-2013, 05:21 PM
  6. Excel Hangs When Tab-Scroll Button is Pressed
    By navillusc in forum Excel General
    Replies: 1
    Last Post: 04-13-2011, 10:02 AM
  7. Create VBA script to short, dedicated button in excel for script?
    By realized in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 12-01-2009, 11:54 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