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 8870797
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 14, 20262026-06-14T17:49:35+00:00 2026-06-14T17:49:35+00:00

I’m trying to program a system in VBA that can add members to excel.

  • 0

I’m trying to program a system in VBA that can add members to excel. It’s quite simple at the moment and i really can’t figure out why i’m getting this error… i have written similar subs and functions to add other entities to my database and they have worked no problem… however when i try and add a new “member” i get this error message “Application defined or object defined error”. Here’s the code, and thanks in advance to anyone that can offer a suggestion.

Sub Member_Sign_Up(MemberId As String)
Dim FirstName As String
Dim LastName As String
Dim PCode As String
Dim NumberOnLoan As String
Dim NextRM As Integer

With Range("A1:F1").Font
    .Bold = True
    End With

Worksheets("Members").Cells(1, 1) = "First Name"            'Set up the headings for the member fields
Worksheets("Members").Cells(1, 2) = "Last Name"             'Also set the font to bold
Worksheets("Members").Cells(1, 3) = "Post Code"
Worksheets("Members").Cells(1, 4) = "Number of Books on Loan"
Worksheets("Members").Cells(1, 5) = "Member ID"
Worksheets("Members").Cells(1, 6) = "Number of Members"

NextRM = Worksheets("Members").Cells(2, 6) + 2              'NextR is the next available row for new data (using the number of different Members to determine when the next free row is)

FirstName = InputBox("First Name?")
LastName = InputBox("Last Name?")
PCode = InputBox("Your Postcode (without spaces)?")

Worksheets("Members").Cells(2, 6) = Worksheets("Members").Cells(2, 6) + 1  'update the Members sheet "number of Members"

Worksheets("Members").Cells(NextRB, 1) = FirstName
Worksheets("Members").Cells(NextRB, 2) = LastName                  'update the Members sheet
Worksheets("Members").Cells(NextRB, 3) = PCode
Worksheets("Members").Cells(NextRB, 5) = MemberId

End Sub

Sub Attempt_Sign_Up()
Dim i As Integer
Dim MemberId As String

MemberId = InputBox("Enter a prefered member ID, it must contain at least five letters and two numbers.")
If Not Check_Member_Exists(MemberId) Then 'And Check_MemberId_Valid(MemberId)
Member_Sign_Up (MemberId)
Else
    MsgBox ("Member with ID " & MemberId & " is already taken or is not valid")
End If

End Sub

Function Check_Member_Exists(MemberId As String) As Boolean

Dim i As Integer
Dim Member_Found As Boolean

Member_Found = False                                      'Set Member_Found to false so that if it becomes true we know a member with that ID already exists
i = 0
Do                                                        'Look through all the cells in Books worksheet with i as the index
    i = i + 1
    If Worksheets("Members").Cells(i, 6) = MemberId Then
        Member_Found = True                                 'Check to see if we've found the ISBN
    End If
Loop Until Member_Found Or i = Worksheets("Members").Cells(2, 6) + 2
Check_Member_Exists = Member_Found


End Function
  • 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-06-14T17:49:36+00:00Added an answer on June 14, 2026 at 5:49 pm

    Change the name of variable NextRM to NextRB as you call it when updating the Members sheet (Worksheets("Members").Cells(NextRB, 1) = FirstName etc) and it works for me.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm new to using the Perl treebuilder module for HTML parsing and can't figure
I am doing a simple coin flipping experiment for class that involves flipping a
I'm parsing an RSS feed that has an ’ in it. SimpleXML turns this
I'm trying to convert HTML to plain text. I get many &\#8217; &\#8220; etc.
I'm trying to decode HTML entries from here NYTimes.com and I cannot figure out
I'm trying to create an if statement in PHP that prevents a single post
I'm working with an upstream system that sometimes sends me text destined for HTML/XML
I am trying to understand how to use SyndicationItem to display feed which is
Basically, what I'm trying to create is a page of div tags, each has
I have a string like this: La Torre Eiffel paragonata all’Everest What PHP function

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.