
llenar datos impares
Publicado por Ronal (8 intervenciones) el 08/05/2014 21:52:20
buen dia.....
tengo un formulario que me llena muy bien los datos al introducirlos, los que sucede que es hay dos usuarios usando el archivo, entonces genera conflicto al momento de grabar........ lo que pienso es que seria bueno que la usuario 1 le grabe en filas impares y el usuario 2 le grabe en las pares.
no se como modificar el cod que ya tengo para que me grabe así, cabe decir que la usuaria 1 tendría un formulario y la usuaria dos tiene otro.
el cod que tengo para el formulario es el siguiente.
Private Sub Agregadat_Click()
Dim ifila As Long, R As Worksheet, mes As Date
Set R = ActiveSheet
'Encuentra la siguiente fila vacía
ifila = R.Cells(Rows.Count, 1).End(xlUp).Offset(1, 0).Row
If Me.Textced.Value = "" Then
Me.Textced.SetFocus
MsgBox "Por favor, digite una cédula.", vbCritical, "Actualizar datos"
Exit Sub
End If
Call Bordes
On Error Resume Next
R.Cells(ifila, 1).Value = Date
mes = Month(R.Cells(ifila, 1).Value)
R.Cells(ifila, 2).Value = UCase(MonthName(mes))
R.Cells(ifila, 3) = Me.Textced.Value
R.Cells(ifila, 4) = Me.Textnom.Value
R.Cells(ifila, 5) = Me.Combalm.Value
R.Cells(ifila, 6) = Me.Combemp.Value
R.Cells(ifila, 7) = Me.Textvals.Value
R.Cells(ifila, 8) = Me.Textvalo.Value
R.Cells(ifila, 9) = CDate(Me.Textfecho.Value)
R.Cells(ifila, 10) = Me.Combobser.Value
R.Cells(ifila, 12) = Me.Combaser.Value
R.Cells(ifila, 13).Value = "1"
If R.Cells(ifila, 10) = "APROBADO" Then
R.Cells(ifila, 11).Value = "APROBADO"
ElseIf R.Cells(ifila, 10) = "" Then
R.Cells(ifila, 11).Value = "PENDIENTE"
Else
R.Cells(ifila, 11).Value = "NEGADO"
End If
R.Cells(ifila, 7).NumberFormat = "$ #,##0"
R.Cells(ifila, 8).NumberFormat = "$ #,##0"
R.Cells(ifila, 9).NumberFormat = "dd/MM/yyyy"
Me.Combalm.Clear
Me.Combemp.Clear
Me.Combobser.Clear
Me.Textced.Value = ""
Me.Textnom.Value = ""
Me.Combalm.Value = ""
Me.Combemp.Value = ""
Me.Textvals.Value = ""
Me.Textvalo.Value = ""
Me.Textfecho.Value = ""
Me.Combobser.Value = ""
Me.Combaser.Value = ""
Me.Textfech.Text = Format(Now, "dd/MM/yyyy")
Call cargar
ActiveWorkbook.Save
End Sub
mil gracias.
tengo un formulario que me llena muy bien los datos al introducirlos, los que sucede que es hay dos usuarios usando el archivo, entonces genera conflicto al momento de grabar........ lo que pienso es que seria bueno que la usuario 1 le grabe en filas impares y el usuario 2 le grabe en las pares.
no se como modificar el cod que ya tengo para que me grabe así, cabe decir que la usuaria 1 tendría un formulario y la usuaria dos tiene otro.
el cod que tengo para el formulario es el siguiente.
Private Sub Agregadat_Click()
Dim ifila As Long, R As Worksheet, mes As Date
Set R = ActiveSheet
'Encuentra la siguiente fila vacía
ifila = R.Cells(Rows.Count, 1).End(xlUp).Offset(1, 0).Row
If Me.Textced.Value = "" Then
Me.Textced.SetFocus
MsgBox "Por favor, digite una cédula.", vbCritical, "Actualizar datos"
Exit Sub
End If
Call Bordes
On Error Resume Next
R.Cells(ifila, 1).Value = Date
mes = Month(R.Cells(ifila, 1).Value)
R.Cells(ifila, 2).Value = UCase(MonthName(mes))
R.Cells(ifila, 3) = Me.Textced.Value
R.Cells(ifila, 4) = Me.Textnom.Value
R.Cells(ifila, 5) = Me.Combalm.Value
R.Cells(ifila, 6) = Me.Combemp.Value
R.Cells(ifila, 7) = Me.Textvals.Value
R.Cells(ifila, 8) = Me.Textvalo.Value
R.Cells(ifila, 9) = CDate(Me.Textfecho.Value)
R.Cells(ifila, 10) = Me.Combobser.Value
R.Cells(ifila, 12) = Me.Combaser.Value
R.Cells(ifila, 13).Value = "1"
If R.Cells(ifila, 10) = "APROBADO" Then
R.Cells(ifila, 11).Value = "APROBADO"
ElseIf R.Cells(ifila, 10) = "" Then
R.Cells(ifila, 11).Value = "PENDIENTE"
Else
R.Cells(ifila, 11).Value = "NEGADO"
End If
R.Cells(ifila, 7).NumberFormat = "$ #,##0"
R.Cells(ifila, 8).NumberFormat = "$ #,##0"
R.Cells(ifila, 9).NumberFormat = "dd/MM/yyyy"
Me.Combalm.Clear
Me.Combemp.Clear
Me.Combobser.Clear
Me.Textced.Value = ""
Me.Textnom.Value = ""
Me.Combalm.Value = ""
Me.Combemp.Value = ""
Me.Textvals.Value = ""
Me.Textvalo.Value = ""
Me.Textfecho.Value = ""
Me.Combobser.Value = ""
Me.Combaser.Value = ""
Me.Textfech.Text = Format(Now, "dd/MM/yyyy")
Call cargar
ActiveWorkbook.Save
End Sub
mil gracias.
Valora esta pregunta


0