musicexpress
05-07-2007, 06:13 AM
Thanks to Ken Puls for bringing me into this wonderful VBA forum. A really eye-opening forum with lotsa gurus here. :thumb:thumb:thumb
Recently have written some VBA code (via Macro Recorder) and modified it to process files and outputs as a standard Excel workbook.
Basically the daily CSV file (file1) is checked via a masterfile (file2) and the script outputs as a nicely tabulated results.
Program worked nicely. Went onto create a simple userform to replicate the process.
I have more or less created the codes for Browse1, Browse2, Process and Cancel buttons.
Basically the user only needs to input 2 files to process it.
The Process button has to be disabled (greyed-out) until the 2 files are specified. (apologies for not able to hotlink the snapshot here, due to newbie status:help)
Pseudocode is as shown:
Public flag1, flag2 As Boolean
Private Sub CommandBrowse1_Click()
' gets file1
' set flag1 = True if file1 is gotten, else flag1 = False
End Sub
Private Sub CommandBrowse2_Click()
' gets file2
' set flag2 = True if file2 is gotten, else flag2 = False
End Sub
Private Sub CommandProcess_Click()
' checks if flag1 AND flag2 are both true, Process button is enabled and executes
End Sub
Private Sub CommandCancel_Click()
' closes Userform and exits
End Sub
Private Sub TextBoxFile1_Change()
' displays the path and name of file1.
' how to disable cursor, as user need not enter the path?
End Sub
Private Sub TextBoxFile2_Change()
' displays the path and name of file2.
' disable cursor, as user need not enter the path?
End Sub
Private Sub CheckBox1_Click()
' how to get the value of the checkbox?
End Sub
Any kind advises/tips/ will be most appreciated. Many thanks all for taking the time to read.
Recently have written some VBA code (via Macro Recorder) and modified it to process files and outputs as a standard Excel workbook.
Basically the daily CSV file (file1) is checked via a masterfile (file2) and the script outputs as a nicely tabulated results.
Program worked nicely. Went onto create a simple userform to replicate the process.
I have more or less created the codes for Browse1, Browse2, Process and Cancel buttons.
Basically the user only needs to input 2 files to process it.
The Process button has to be disabled (greyed-out) until the 2 files are specified. (apologies for not able to hotlink the snapshot here, due to newbie status:help)
Pseudocode is as shown:
Public flag1, flag2 As Boolean
Private Sub CommandBrowse1_Click()
' gets file1
' set flag1 = True if file1 is gotten, else flag1 = False
End Sub
Private Sub CommandBrowse2_Click()
' gets file2
' set flag2 = True if file2 is gotten, else flag2 = False
End Sub
Private Sub CommandProcess_Click()
' checks if flag1 AND flag2 are both true, Process button is enabled and executes
End Sub
Private Sub CommandCancel_Click()
' closes Userform and exits
End Sub
Private Sub TextBoxFile1_Change()
' displays the path and name of file1.
' how to disable cursor, as user need not enter the path?
End Sub
Private Sub TextBoxFile2_Change()
' displays the path and name of file2.
' disable cursor, as user need not enter the path?
End Sub
Private Sub CheckBox1_Click()
' how to get the value of the checkbox?
End Sub
Any kind advises/tips/ will be most appreciated. Many thanks all for taking the time to read.