Dispatch Log VBA

Timmer7

New Member
Joined
Jun 27, 2010
Messages
16
Hi,

I'm getting back in the saddle with excel again and was hoping I could get help with some VBA for what I want to do with our dispatching capabilities.

Please see images. I have a source sheet with data which is to be copied to my Dispatch_Data sheet when in the column A list the proper code is chosen; the copied part would go into columns B:K or however many columns I needed from the source sheet; column B (2) would also put in the current date & time (military). My goal is add multiple lines to the source sheet as I go here. If anyone's able to help me with this, much thanks in advance!

Sincerely,

Timmer

Dispatch Log.xlsx
ABCDEFGHIJK
1
2
3
4
5
6Code Red5/25/2024 14:00Location:Officer: Details:Device:Time Completed:Misc:
7Patient Assist5/25/2024 18:00Location:Caller:Details:Other Inv:Time Completed:Misc:
8Code Pink
9
10
11
12
13
14
Dispatch_Data
Cells with Data Validation
CellAllowCriteria
A6:A14List=Calls



Dispatch Log.xlsx
ABCDEFGHIJKL
1
2
3
4
5
6Code Red5/25/2024 14:00Location:Officer: Details:Device:Time Completed:Misc:
7Patient Assist5/25/2024 18:00Location:Caller:Details:Other Inv:Time Completed:Misc:
8
9
Source
 

Excel Facts

Save Often
If you start asking yourself if now is a good time to save your Excel workbook, the answer is Yes
in the column A list the proper code is chosen
Column A of which sheet?
column B (2) would also put in the current date & time (military)
It appears that this information is already in column B of the Source sheet. Please clarify in detail referring to specific cells, rows, columns and sheets using an example from your data.
 
Upvote 0
One method is to use a UserForm with TEXT fields matching the entries of the cells on your Dispatch Log. The UserForm is where you would enter your data then use
a CommandButton on the UserForm to send the data there to the Dispatch Sheet for storage. Attached is a small example project using a UserForm. Study the design
and formatting then edit it to match your project.

VBA 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 sample file : Internxt Drive – Private & Secure Cloud Storage
 
Upvote 0

Forum statistics

Threads
1,223,885
Messages
6,175,187
Members
452,616
Latest member
intern444

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