Emoncada
04-09-2007, 09:12 AM
I have this code
Private Sub CommandButton1_Click()
TxtFinalStatus = "Complete"
End Sub
Private Sub CommandButton2_Click()
'Add New Button to your UserForm so you press to Apply Data to Sheet
Dim RowNext As Integer
'last row of data puls one row
RowNext = Worksheets("Server Build Template").Cells(65536, 1).End(xlUp).Row + 1
'Cells(Row Number,Column Number)
With Worksheets("Server Build Template")
.Cells(RowNext, 1) = TxtName.Value
.Cells(RowNext, 2) = LblDate.Caption
.Cells(RowNext, 3) = TxtServerName.Value
.Cells(RowNext, 4) = TxtLocation.Value
If Me.ButtonG4 = True Then .Cells(RowNext, 5) = Me.LblML370G4.Caption
If Me.ButtonG5 = True Then .Cells(RowNext, 5) = Me.LblML370G5.Caption
.Cells(RowNext, 6) = TxtCtsContact.Value
.Cells(RowNext, 7) = TxtTracking.Value
If Me.Button72 = True Then .Cells(RowNext, 8) = Me.Lbl728GB.Caption
If Me.Button146 = True Then .Cells(RowNext, 8) = Me.Lbl146GB.Caption
.Cells(RowNext, 9) = TxtDrive1SN.Value
.Cells(RowNext, 10) = TxtDrive2SN.Value
.Cells(RowNext, 11) = TxtDrive3SN.Value
.Cells(RowNext, 12) = TxtDrive4SN.Value
.Cells(RowNext, 13) = TxtFinalStatus.Value
.Cells(RowNext, 14) = TxtSignature.Value
End With
ServerBuild.PrintForm
'You can't save a worksheet
ActiveWorkbook.Save
End Sub
Private Sub CommandButton3_Click()
ServerBuild.Hide
End Sub
Private Sub CommandButton4_Click()
TxtName.Value = ""
LblDate.Caption = ""
TxtServerName.Value = ""
TxtLocation.Value = ""
TxtCtsContact.Value = ""
TxtTracking.Value = ""
Me.ButtonG4 = False
Me.ButtonG5 = False
Me.Button146 = False
Me.Button72 = False
TxtDrive1SN.Value = ""
TxtDrive2SN.Value = ""
TxtDrive3SN.Value = ""
TxtDrive4SN.Value = ""
TxtFinalStatus.Value = ""
TxtSignature.Value = ""
TxtName.SetFocus
End Sub
Private Sub CommandButton5_Click()
TxtSignature = TxtName.Value
End Sub
Private Sub Txtname_AfterUpdate()
If TxtName = "" Then
LblDate.Caption = ""
Else
LblDate.Caption = Format(Now, "mm/dd/yyyy") & " " & Format(Now, "hh:mm:ss AM/PM")
End If
End Sub
How Can I make the TxtServerName a link on the spreadsheet so if I need to return to it I can click it and the form would pop up and pull the data of that line into the form for editing?
Any Ideas?
Private Sub CommandButton1_Click()
TxtFinalStatus = "Complete"
End Sub
Private Sub CommandButton2_Click()
'Add New Button to your UserForm so you press to Apply Data to Sheet
Dim RowNext As Integer
'last row of data puls one row
RowNext = Worksheets("Server Build Template").Cells(65536, 1).End(xlUp).Row + 1
'Cells(Row Number,Column Number)
With Worksheets("Server Build Template")
.Cells(RowNext, 1) = TxtName.Value
.Cells(RowNext, 2) = LblDate.Caption
.Cells(RowNext, 3) = TxtServerName.Value
.Cells(RowNext, 4) = TxtLocation.Value
If Me.ButtonG4 = True Then .Cells(RowNext, 5) = Me.LblML370G4.Caption
If Me.ButtonG5 = True Then .Cells(RowNext, 5) = Me.LblML370G5.Caption
.Cells(RowNext, 6) = TxtCtsContact.Value
.Cells(RowNext, 7) = TxtTracking.Value
If Me.Button72 = True Then .Cells(RowNext, 8) = Me.Lbl728GB.Caption
If Me.Button146 = True Then .Cells(RowNext, 8) = Me.Lbl146GB.Caption
.Cells(RowNext, 9) = TxtDrive1SN.Value
.Cells(RowNext, 10) = TxtDrive2SN.Value
.Cells(RowNext, 11) = TxtDrive3SN.Value
.Cells(RowNext, 12) = TxtDrive4SN.Value
.Cells(RowNext, 13) = TxtFinalStatus.Value
.Cells(RowNext, 14) = TxtSignature.Value
End With
ServerBuild.PrintForm
'You can't save a worksheet
ActiveWorkbook.Save
End Sub
Private Sub CommandButton3_Click()
ServerBuild.Hide
End Sub
Private Sub CommandButton4_Click()
TxtName.Value = ""
LblDate.Caption = ""
TxtServerName.Value = ""
TxtLocation.Value = ""
TxtCtsContact.Value = ""
TxtTracking.Value = ""
Me.ButtonG4 = False
Me.ButtonG5 = False
Me.Button146 = False
Me.Button72 = False
TxtDrive1SN.Value = ""
TxtDrive2SN.Value = ""
TxtDrive3SN.Value = ""
TxtDrive4SN.Value = ""
TxtFinalStatus.Value = ""
TxtSignature.Value = ""
TxtName.SetFocus
End Sub
Private Sub CommandButton5_Click()
TxtSignature = TxtName.Value
End Sub
Private Sub Txtname_AfterUpdate()
If TxtName = "" Then
LblDate.Caption = ""
Else
LblDate.Caption = Format(Now, "mm/dd/yyyy") & " " & Format(Now, "hh:mm:ss AM/PM")
End If
End Sub
How Can I make the TxtServerName a link on the spreadsheet so if I need to return to it I can click it and the form would pop up and pull the data of that line into the form for editing?
Any Ideas?