VBA needed please

Jason Brown

New Member
Joined
May 2, 2018
Messages
11
So we will eventually have three spreadsheets, but for now we're getting the ball rolling with two. The first sheet is for individual employees to keep track of issues that arise. Various columns to track the aspects of each issue. I wanted to have the data automatically written from the individual employee sheet/workbook, to a distinct workbook where each employees logged entries would be recorded. I started with this, and while it wrote the first line of test data, it failed to do the second with a debug pointing at the first offset.

Code:
Private Sub CommandButton1_Click()
Dim IssueNumber As String
** 23 more is there a short cut? **
Dim master as workbook
worksheets("1").select
IssueNumber=Range("a2")
** same 23 **
Set master=workbooks.open("address location")
Worksheets("sheet1").select
worksheets("sheet1").range("a2").select
Rowcount=worksheets("Sheet1").range("A2")
.offset(rowcount, 0)=issuenumber
** 23 more with 0 increasing by 1 each time**
End with
master.save
Also, is there any good books that can give me a foundation?
 
Last edited by a moderator:

Excel Facts

Waterfall charts in Excel?
Office 365 customers have access to Waterfall charts since late 2016. They were added to Excel 2019.
.
Sounds like you want a simple database. Write data to rows from a UserForm ?

Code:
Option Explicit
Private Sub btnCancel_Click()
    Unload Me
End Sub


Private Sub btnOK_Click()
    Dim ws As Worksheet
    Set ws = ActiveSheet
    Dim newRow As Long
    
    newRow = Application.WorksheetFunction.CountA(ws.Range("A:A")) + 1
    
    'The next two lines can be expanded as many times as needed for all the entry fields in your project
    
    ws.Cells(newRow, 1).Value = Me.txtFirstName.Value
    ws.Cells(newRow, 2).Value = Me.txtSurname.Value
    
End Sub
Sub CommandButton1_Click()
    Selection.EntireRow.Delete
End Sub

Download link : https://www.amazon.com/clouddrive/share/6muIyvGEpUi9lCUYvhoSgEdPhngepPRdHeU4hyy7V9v
 
Upvote 0

Forum statistics

Threads
1,224,823
Messages
6,181,176
Members
453,021
Latest member
Justyna P

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top