Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 705311
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 14, 20262026-05-14T04:02:21+00:00 2026-05-14T04:02:21+00:00

I am trying to create a list that adds a new row of data

  • 0

I am trying to create a list that adds a new row of data each time a button is clicked. I have the following code assigned to the button when clicked:

    PurchaseDate = InputBox("Enter Purchase Date:")
    Sheets("TrackRecord").Select
    i = 0
    Row = i + 1
    Range("A2").Select
    ActiveCell.FormulaR1C1 = Row
    Range("B2").Select
    ActiveCell.FormulaR1C1 = "=Dashboard!R26C4*(1/Dashboard!R26C12)"
    Range("C2").Select
    ActiveCell.FormulaR1C1 = "=Dashboard!R26C2"
    Range("D2").Select
    ActiveCell.FormulaR1C1 = PurchaseDate
    Range("E2").Select
    ActiveCell.FormulaR1C1 = "=Dashboard!R26C8 + R2C4"
    Range("F2").Select
    ActiveCell.FormulaR1C1 = "=Waterfall!R[8]C[5]"
    Range("F2").Select
    Selection.AutoFill Destination:=Range("F2:I2"), Type:=xlFillDefault
    Range("F2:I2").Select
End Sub

This code works fine, but I’d like it populate the next row below instead of overwriting the same row each time the button is clicked. I know that I have to iterate through the “Range(“A2″).select” section, e.g. “Range(“A2″).select” –> “Range(“B2″).select” .. But I don’t know how to do this in VBA for Excel. That’s why I am asking you folks ; ) .

Thanks,

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-14T04:02:21+00:00Added an answer on May 14, 2026 at 4:02 am

    If you want to persist the next row even when you close excel and open it again, it’s better to find the last row each time.

     Dim Row As Long
    
        Row = GetNextRow(Sheets("TrackRecord"), "A") 
    
        PurchaseDate = InputBox("Enter Purchase Date:") 
    
        Sheets("TrackRecord").Select 
    
        Range("A" & Row).Select 
        ActiveCell.FormulaR1C1 = Row 
        Range("B" & Row).Select 
        ActiveCell.FormulaR1C1 = "=Dashboard!R26C4*(1/Dashboard!R26C12)" 
        Range("C" & Row).Select 
        ActiveCell.FormulaR1C1 = "=Dashboard!R26C2" 
        Range("D" & Row).Select 
        ActiveCell.FormulaR1C1 = PurchaseDate 
        Range("E" & Row).Select 
        ActiveCell.FormulaR1C1 = "=Dashboard!R26C8 + R2C4" 
        Range("F" & Row).Select 
        ActiveCell.FormulaR1C1 = "=Waterfall!R[8]C[5]" 
        Range("F" & Row).Select 
        Selection.AutoFill Destination:=Range("F" & Row & ":I" & Row), Type:=xlFillDefault 
        Range("F" & Row & ":I" & Row).Select 
    End Sub 
    
    
    Private Function GetNextRow(sheet As Worksheet, column As String) As Long
    
        'Look for the first empty row in the specified column
    
        Dim Row As Long
    
        For Row = 1 To 65535
            If sheet.Range(column & Row).Formula = "" Then
                GetNextRow = Row
                Exit For
            End If
        Next Row
    
    End Function
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am trying to create a list box that displays a set of data
I am trying to create a drop down list that incorporates database data and
I am trying to create a master list of several excel data that I
I'm trying to create a list in Oz using the following code: local Loop10
I'm trying to create a list that some of the elements are defined and
I'm trying to create a list of tasks that I've read from some text
I'm trying to create a drop down list that populates from a database. I
I am trying to create an array or list that could handle in theory,
I'm trying to create a design for a list that looks like (and mostly
I'm trying to create a list of permutations of a list, such that, for

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.