• Hi All

    Please note that at the Chandoo.org Forums there is Zero Tolerance to Spam

    Post Spam and you Will Be Deleted as a User

    Hui...

  • When starting a new post, to receive a quicker and more targeted answer, Please include a sample file in the initial post.

Help to amend code on user form

Kellis

Member
Hello all

I would like to amend my userform, at present I have a control Add Switcher which takes the data entered by the form user and adds to my spreadsheet this is good and the code I have works on the first row below, however I decided it would easier for users rather than complete one line and the hit Add Switcher they could complete multiple lines at a time. the problem is I do not know how to amend my code. Can anyone suggest how I can amend my code so all lines update tothe sheet at once or suggest a better way of doing this.
I need lines for multiple switchers to be added

Thanks

The code I have at present

Code:
Private Sub cmdAddSwitcher_Click()
'''' Add Switcher Command - clear and add new row to Nearest switcher
Dim ctl As Control

RowCount = Worksheets("Nearest Switchers").Range("A1").CurrentRegion.Rows.Count
   
    With Worksheets("Nearest Switchers").Range("A1")
   
        .Offset(RowCount, 0).Value = Me.txtSIMSJN
        .Offset(RowCount, 1).Value = Me.txtName1.Value
             
    If Me.chkMobTried1.Value = True Then
        .Offset(RowCount, 2).Value = "Yes"
       
  Else
        .Offset(RowCount, 2).Value = "No"
       
        End If
             
        If Me.chkHomeTried1.Value = True Then
        .Offset(RowCount, 3).Value = "Yes"
       
  Else
        .Offset(RowCount, 3).Value = "No"
       
        End If
       
       
        If Me.chkAttending1.Value = True Then
        .Offset(RowCount, 4).Value = "Yes"
       
  Else
        .Offset(RowCount, 4).Value = "No"
       
        End If
       
        .Offset(RowCount, 5).Value = Me.cboRole1.Value
        .Offset(RowCount, 6).Value = Me.txtETA1.Value
       
        If Me.chkStdby1.Value = True Then
        .Offset(RowCount, 7).Value = "Yes"
       
  Else
        .Offset(RowCount, 7).Value = "No"
       
      End If
       
       
      End With
     
   
    For Each ctl In Me.Controls
   
    Me.txtName1 = Null
    Me.chkMobTried1 = False
    Me.chkHomeTried1 = False
    Me.chkAttending1 = False
    Me.cboRole1 = Null
    Me.txtETA1 = Null
    Me.chkStdby1 = False
   
   
   
      Next ctl
   
End Sub

upload_2014-9-23_1-43-32.png
 
Hi Narayan

I do not understand I have nothing much on my workbook yet I receive a message saying the file is to large.
 
Hi Kellis ,

This forum can accept files for upload , only as long as they are less than 1 MB in size ; anything more , and you will have to use public file-sharing websites such as RapidShare , SpeedyShare , GoogleDocs , DropBox , SkyDrive.

Upload your file to anyone of the above websites , give others permission to download and open your file , and post the access link here in this same thread.

Narayan
 
Back
Top