SlideShare una empresa de Scribd logo
1 de 14
REGISTRO DE CLIENTES
REGISTRO DE CLIENTES
frm_Clientes
txt_Telefono
txt_ID
txt_Email
txt_Direccion
cbo_Nombre
txt_Direccion
fotografia
cmd_Imagen
cmd_Cerrarcmd_Agregar cmd_Eliminar
REGISTRO DE CLIENTES
CÓDIGOFORMULARIOS
AGREGAR
Option Explicit
Dim ArchivoIMG As String
Private Sub cmd_Agregar_Click()
Dim i As Integer
If cbo_Nombre.Text= "" Then
MsgBox"Nombre inválido",vbInformation+ vbOKOnly
cbo_Nombre.SetFocus
ExitSub
End If
If Not (Mid(cbo_Nombre.Text,1,1) Like "[a-z]" OrMid(cbo_Nombre.Text,1,1) Like "[A-Z]") Then
MsgBox "Nombre inválido",vbInformation+ vbOKOnly cbo_Nombre.SetFocus
ExitSub
End If
REGISTRO DE CLIENTES
For i = 2 To Len(cbo_Nombre.Text)
IfMid(cbo_Nombre.Text,i,1) Like "#" Then
MsgBox "Nombre inválido",vbInformation+ vbOKOnly
cbo_Nombre.SetFocus
Exit Sub
End If
Next
Sheets("Clientes").Activate
Dim fCliente AsInteger fCliente =
nCliente(cbo_Nombre.Text)
If fCliente =0 Then
Do While NotIsEmpty(ActiveCell)
ActiveCell.Offset(1,0).Activate ' si el registro no existe,se va al final.
Loop
REGISTRO DE CLIENTES
Else
Cells(fCliente,1).Select ' cuando ya existe el registro,cumple esta condición.
End If
'Aqui es cuando agregamos o modificamosel registro
Application.ScreenUpdating=False
ActiveCell = cbo_Nombre
ActiveCell.Offset(0,1) = txt_Direccion
ActiveCell.Offset(0,2) = txt_Telefono
ActiveCell.Offset(0,3) = txt_ID
ActiveCell.Offset(0,4) = txt_Email
ActiveCell.Offset(0,5) = ArchivoIMG
txt_Direccion= Empty
txt_Telefono= Empty
txt_ID = Empty txt_Email
= Empty cbo_Nombre =
Empty
REGISTRO DE CLIENTES
Application.ScreenUpdating
= True
cbo_Nombre.SetFocus
End Sub
ELIMINAR
Private Subcmd_Eliminar_Click() Dim
fCliente AsInteger fCliente=
nCliente(cbo_Nombre.Text)
If fCliente=0 Then
MsgBox "El cliente que ustedquiere eliminarnoexiste",vbInformation+vbOKOnly
cbo_Nombre.SetFocus
ExitSub
End If
REGISTRO DE CLIENTES
If MsgBox("¿Seguroque quiere eliminareste cliente?",vbQuestion+vbYesNo) =vbYesThen Cells(fCliente,1).Select
ActiveCell.EntireRow.Delete
MsgBox "Cliente eliminado", vbInformation+vbOKOnly
cbo_Nombre.SetFocus
End If
End Sub
CERRAR
Private Subcmd_Cerrar_Click()
End
End Sub
COMBOBOX o CUADRO COMBINADO cbo_Nombre
Private Subcbo_Nombre_Change()
On Error Resume Next
REGISTRO DE CLIENTES
If nCliente(cbo_Nombre.Text) <>0 Then
Sheets("Clientes").Activate
Cells(cbo_Nombre.ListIndex +2, 1).Select
txt_Direccion=ActiveCell.Offset(0,1)
txt_Telefono=ActiveCell.Offset(0,2)
txt_ID = ActiveCell.Offset(0,3) txt_Email =
ActiveCell.Offset(0,4)
fotografia.Picture =LoadPicture("")
fotografia.Picture =LoadPicture(ActiveCell.Offset(0,5))
ArchivoIMG= ActiveCell.Offset(0,5)
Else
REGISTRO DE CLIENTES
txt_Direccion="" txt_Telefono
= "" txt_ID = "" txt_Email = ""
ArchivoIMG= "" fotografia.Picture
= LoadPicture("")
End If
End Sub
Private Subcbo_Nombre_Enter()
CargarLista
End SubSub
CargarLista()
cbo_Nombre.Clear
Sheets("Clientes").Select
Range("A2").Select Do While Not
IsEmpty(ActiveCell)
cbo_Nombre.AddItemActiveCell.Value
ActiveCell.Offset(1,0).Select
Loop
REGISTRO DE CLIENTES
End Sub
SubLimpiarFormulario()
CargarLista
cbo_Nombre = ""
txt_Direccion=""
txt_Telefono=""
txt_ID = "" txt_Email
= ""
ArchivoIMG= "" End
Sub
cmd_Imagen
Private Sub cmd_Imagen_Click()
On Error Resume Next
ArchivoIMG = Application.GetOpenFilename("Imágenes jpg,*.jpg,Imágenes bmp,*.bmp", 0, "Seleccionar Imágen para Reegistro de
Clientes")
REGISTRO DE CLIENTES
fotografia.Picture = LoadPicture("")
fotografia.Picture = LoadPicture(ArchivoIMG)
End Sub
MÓDULO 1
Option Explicit
Sub registrar()
Load frm_Clientes
Sheets("clientes").Activate
frm_Clientes.Show
End Sub
Function nCliente(nombre As String) As Integer
Application.ScreenUpdating = False
Sheets("Clientes").Activate
Range("A2").Activate
REGISTRO DE CLIENTES
nCliente = 0
Do While Not IsEmpty(ActiveCell)
If nombre = ActiveCell Then
nCliente = ActiveCell.Row
End If
ActiveCell.Offset(1, 0).Select
Loop
Application.ScreenUpdating = True
End Function
REGISTRO DE CLIENTES
REGISTRO DE CLIENTES

Más contenido relacionado

Destacado

株式会社オークネット様 Veeam導入事例
株式会社オークネット様 Veeam導入事例株式会社オークネット様 Veeam導入事例
株式会社オークネット様 Veeam導入事例株式会社クライム
 
Docker
DockerDocker
DockerNarato
 
SCOMと管理パックで DBや仮想環境の監視のお悩みを解決
SCOMと管理パックでDBや仮想環境の監視のお悩みを解決SCOMと管理パックでDBや仮想環境の監視のお悩みを解決
SCOMと管理パックで DBや仮想環境の監視のお悩みを解決株式会社クライム
 
Auto richsaw tricycle
Auto richsaw tricycleAuto richsaw tricycle
Auto richsaw tricyclevasanramkumar
 
Design ROI _ Measurable Design_21032013
Design ROI _ Measurable Design_21032013Design ROI _ Measurable Design_21032013
Design ROI _ Measurable Design_21032013Antti Pitkänen
 
WIreless Power Transmission
WIreless Power TransmissionWIreless Power Transmission
WIreless Power TransmissionDebasis Padhi
 
Haemocytometer ppt animal cell culture
Haemocytometer ppt animal cell cultureHaemocytometer ppt animal cell culture
Haemocytometer ppt animal cell culturevinitha unnikrishnan
 
Rancher Meetup Tokyo#3 Storageについて
Rancher Meetup Tokyo#3 StorageについてRancher Meetup Tokyo#3 Storageについて
Rancher Meetup Tokyo#3 StorageについてTetsurou Yano
 
Hemograma em idosos (pacientes geriátricos)
Hemograma em idosos (pacientes geriátricos)Hemograma em idosos (pacientes geriátricos)
Hemograma em idosos (pacientes geriátricos)João Marcos
 
Hum2310 conceiving the cosmos defining myth & its four functions
Hum2310 conceiving the cosmos   defining myth & its four functionsHum2310 conceiving the cosmos   defining myth & its four functions
Hum2310 conceiving the cosmos defining myth & its four functionsProfWillAdams
 

Destacado (12)

株式会社オークネット様 Veeam導入事例
株式会社オークネット様 Veeam導入事例株式会社オークネット様 Veeam導入事例
株式会社オークネット様 Veeam導入事例
 
Docker
DockerDocker
Docker
 
SCOMと管理パックで DBや仮想環境の監視のお悩みを解決
SCOMと管理パックでDBや仮想環境の監視のお悩みを解決SCOMと管理パックでDBや仮想環境の監視のお悩みを解決
SCOMと管理パックで DBや仮想環境の監視のお悩みを解決
 
Auto richsaw tricycle
Auto richsaw tricycleAuto richsaw tricycle
Auto richsaw tricycle
 
Design ROI _ Measurable Design_21032013
Design ROI _ Measurable Design_21032013Design ROI _ Measurable Design_21032013
Design ROI _ Measurable Design_21032013
 
Diffusion Future Ready
Diffusion Future ReadyDiffusion Future Ready
Diffusion Future Ready
 
WIreless Power Transmission
WIreless Power TransmissionWIreless Power Transmission
WIreless Power Transmission
 
Jesus the son of God
Jesus the son of GodJesus the son of God
Jesus the son of God
 
Haemocytometer ppt animal cell culture
Haemocytometer ppt animal cell cultureHaemocytometer ppt animal cell culture
Haemocytometer ppt animal cell culture
 
Rancher Meetup Tokyo#3 Storageについて
Rancher Meetup Tokyo#3 StorageについてRancher Meetup Tokyo#3 Storageについて
Rancher Meetup Tokyo#3 Storageについて
 
Hemograma em idosos (pacientes geriátricos)
Hemograma em idosos (pacientes geriátricos)Hemograma em idosos (pacientes geriátricos)
Hemograma em idosos (pacientes geriátricos)
 
Hum2310 conceiving the cosmos defining myth & its four functions
Hum2310 conceiving the cosmos   defining myth & its four functionsHum2310 conceiving the cosmos   defining myth & its four functions
Hum2310 conceiving the cosmos defining myth & its four functions
 

Último

ACUERDO MINISTERIAL 078-ORGANISMOS ESCOLARES..pptx
ACUERDO MINISTERIAL 078-ORGANISMOS ESCOLARES..pptxACUERDO MINISTERIAL 078-ORGANISMOS ESCOLARES..pptx
ACUERDO MINISTERIAL 078-ORGANISMOS ESCOLARES..pptxzulyvero07
 
Identificación de componentes Hardware del PC
Identificación de componentes Hardware del PCIdentificación de componentes Hardware del PC
Identificación de componentes Hardware del PCCesarFernandez937857
 
2024 - Expo Visibles - Visibilidad Lesbica.pdf
2024 - Expo Visibles - Visibilidad Lesbica.pdf2024 - Expo Visibles - Visibilidad Lesbica.pdf
2024 - Expo Visibles - Visibilidad Lesbica.pdfBaker Publishing Company
 
Informatica Generalidades - Conceptos Básicos
Informatica Generalidades - Conceptos BásicosInformatica Generalidades - Conceptos Básicos
Informatica Generalidades - Conceptos BásicosCesarFernandez937857
 
SELECCIÓN DE LA MUESTRA Y MUESTREO EN INVESTIGACIÓN CUALITATIVA.pdf
SELECCIÓN DE LA MUESTRA Y MUESTREO EN INVESTIGACIÓN CUALITATIVA.pdfSELECCIÓN DE LA MUESTRA Y MUESTREO EN INVESTIGACIÓN CUALITATIVA.pdf
SELECCIÓN DE LA MUESTRA Y MUESTREO EN INVESTIGACIÓN CUALITATIVA.pdfAngélica Soledad Vega Ramírez
 
EXPANSIÓN ECONÓMICA DE OCCIDENTE LEÓN.pptx
EXPANSIÓN ECONÓMICA DE OCCIDENTE LEÓN.pptxEXPANSIÓN ECONÓMICA DE OCCIDENTE LEÓN.pptx
EXPANSIÓN ECONÓMICA DE OCCIDENTE LEÓN.pptxPryhaSalam
 
FORTI-MAYO 2024.pdf.CIENCIA,EDUCACION,CULTURA
FORTI-MAYO 2024.pdf.CIENCIA,EDUCACION,CULTURAFORTI-MAYO 2024.pdf.CIENCIA,EDUCACION,CULTURA
FORTI-MAYO 2024.pdf.CIENCIA,EDUCACION,CULTURAEl Fortí
 
MAYO 1 PROYECTO día de la madre el amor más grande
MAYO 1 PROYECTO día de la madre el amor más grandeMAYO 1 PROYECTO día de la madre el amor más grande
MAYO 1 PROYECTO día de la madre el amor más grandeMarjorie Burga
 
La empresa sostenible: Principales Características, Barreras para su Avance y...
La empresa sostenible: Principales Características, Barreras para su Avance y...La empresa sostenible: Principales Características, Barreras para su Avance y...
La empresa sostenible: Principales Características, Barreras para su Avance y...JonathanCovena1
 
Neurociencias para Educadores NE24 Ccesa007.pdf
Neurociencias para Educadores  NE24  Ccesa007.pdfNeurociencias para Educadores  NE24  Ccesa007.pdf
Neurociencias para Educadores NE24 Ccesa007.pdfDemetrio Ccesa Rayme
 
la unidad de s sesion edussssssssssssssscacio fisca
la unidad de s sesion edussssssssssssssscacio fiscala unidad de s sesion edussssssssssssssscacio fisca
la unidad de s sesion edussssssssssssssscacio fiscaeliseo91
 
Registro Auxiliar - Primaria 2024 (1).pptx
Registro Auxiliar - Primaria  2024 (1).pptxRegistro Auxiliar - Primaria  2024 (1).pptx
Registro Auxiliar - Primaria 2024 (1).pptxFelicitasAsuncionDia
 
30-de-abril-plebiscito-1902_240420_104511.pdf
30-de-abril-plebiscito-1902_240420_104511.pdf30-de-abril-plebiscito-1902_240420_104511.pdf
30-de-abril-plebiscito-1902_240420_104511.pdfgimenanahuel
 
TEMA 13 ESPAÑA EN DEMOCRACIA:DISTINTOS GOBIERNOS
TEMA 13 ESPAÑA EN DEMOCRACIA:DISTINTOS GOBIERNOSTEMA 13 ESPAÑA EN DEMOCRACIA:DISTINTOS GOBIERNOS
TEMA 13 ESPAÑA EN DEMOCRACIA:DISTINTOS GOBIERNOSjlorentemartos
 
Plan Refuerzo Escolar 2024 para estudiantes con necesidades de Aprendizaje en...
Plan Refuerzo Escolar 2024 para estudiantes con necesidades de Aprendizaje en...Plan Refuerzo Escolar 2024 para estudiantes con necesidades de Aprendizaje en...
Plan Refuerzo Escolar 2024 para estudiantes con necesidades de Aprendizaje en...Carlos Muñoz
 
ACERTIJO DE LA BANDERA OLÍMPICA CON ECUACIONES DE LA CIRCUNFERENCIA. Por JAVI...
ACERTIJO DE LA BANDERA OLÍMPICA CON ECUACIONES DE LA CIRCUNFERENCIA. Por JAVI...ACERTIJO DE LA BANDERA OLÍMPICA CON ECUACIONES DE LA CIRCUNFERENCIA. Por JAVI...
ACERTIJO DE LA BANDERA OLÍMPICA CON ECUACIONES DE LA CIRCUNFERENCIA. Por JAVI...JAVIER SOLIS NOYOLA
 
proyecto de mayo inicial 5 añitos aprender es bueno para tu niño
proyecto de mayo inicial 5 añitos aprender es bueno para tu niñoproyecto de mayo inicial 5 añitos aprender es bueno para tu niño
proyecto de mayo inicial 5 añitos aprender es bueno para tu niñotapirjackluis
 

Último (20)

ACUERDO MINISTERIAL 078-ORGANISMOS ESCOLARES..pptx
ACUERDO MINISTERIAL 078-ORGANISMOS ESCOLARES..pptxACUERDO MINISTERIAL 078-ORGANISMOS ESCOLARES..pptx
ACUERDO MINISTERIAL 078-ORGANISMOS ESCOLARES..pptx
 
Identificación de componentes Hardware del PC
Identificación de componentes Hardware del PCIdentificación de componentes Hardware del PC
Identificación de componentes Hardware del PC
 
2024 - Expo Visibles - Visibilidad Lesbica.pdf
2024 - Expo Visibles - Visibilidad Lesbica.pdf2024 - Expo Visibles - Visibilidad Lesbica.pdf
2024 - Expo Visibles - Visibilidad Lesbica.pdf
 
Informatica Generalidades - Conceptos Básicos
Informatica Generalidades - Conceptos BásicosInformatica Generalidades - Conceptos Básicos
Informatica Generalidades - Conceptos Básicos
 
SELECCIÓN DE LA MUESTRA Y MUESTREO EN INVESTIGACIÓN CUALITATIVA.pdf
SELECCIÓN DE LA MUESTRA Y MUESTREO EN INVESTIGACIÓN CUALITATIVA.pdfSELECCIÓN DE LA MUESTRA Y MUESTREO EN INVESTIGACIÓN CUALITATIVA.pdf
SELECCIÓN DE LA MUESTRA Y MUESTREO EN INVESTIGACIÓN CUALITATIVA.pdf
 
EXPANSIÓN ECONÓMICA DE OCCIDENTE LEÓN.pptx
EXPANSIÓN ECONÓMICA DE OCCIDENTE LEÓN.pptxEXPANSIÓN ECONÓMICA DE OCCIDENTE LEÓN.pptx
EXPANSIÓN ECONÓMICA DE OCCIDENTE LEÓN.pptx
 
FORTI-MAYO 2024.pdf.CIENCIA,EDUCACION,CULTURA
FORTI-MAYO 2024.pdf.CIENCIA,EDUCACION,CULTURAFORTI-MAYO 2024.pdf.CIENCIA,EDUCACION,CULTURA
FORTI-MAYO 2024.pdf.CIENCIA,EDUCACION,CULTURA
 
Tema 8.- PROTECCION DE LOS SISTEMAS DE INFORMACIÓN.pdf
Tema 8.- PROTECCION DE LOS SISTEMAS DE INFORMACIÓN.pdfTema 8.- PROTECCION DE LOS SISTEMAS DE INFORMACIÓN.pdf
Tema 8.- PROTECCION DE LOS SISTEMAS DE INFORMACIÓN.pdf
 
MAYO 1 PROYECTO día de la madre el amor más grande
MAYO 1 PROYECTO día de la madre el amor más grandeMAYO 1 PROYECTO día de la madre el amor más grande
MAYO 1 PROYECTO día de la madre el amor más grande
 
La empresa sostenible: Principales Características, Barreras para su Avance y...
La empresa sostenible: Principales Características, Barreras para su Avance y...La empresa sostenible: Principales Características, Barreras para su Avance y...
La empresa sostenible: Principales Características, Barreras para su Avance y...
 
Neurociencias para Educadores NE24 Ccesa007.pdf
Neurociencias para Educadores  NE24  Ccesa007.pdfNeurociencias para Educadores  NE24  Ccesa007.pdf
Neurociencias para Educadores NE24 Ccesa007.pdf
 
la unidad de s sesion edussssssssssssssscacio fisca
la unidad de s sesion edussssssssssssssscacio fiscala unidad de s sesion edussssssssssssssscacio fisca
la unidad de s sesion edussssssssssssssscacio fisca
 
Registro Auxiliar - Primaria 2024 (1).pptx
Registro Auxiliar - Primaria  2024 (1).pptxRegistro Auxiliar - Primaria  2024 (1).pptx
Registro Auxiliar - Primaria 2024 (1).pptx
 
30-de-abril-plebiscito-1902_240420_104511.pdf
30-de-abril-plebiscito-1902_240420_104511.pdf30-de-abril-plebiscito-1902_240420_104511.pdf
30-de-abril-plebiscito-1902_240420_104511.pdf
 
TEMA 13 ESPAÑA EN DEMOCRACIA:DISTINTOS GOBIERNOS
TEMA 13 ESPAÑA EN DEMOCRACIA:DISTINTOS GOBIERNOSTEMA 13 ESPAÑA EN DEMOCRACIA:DISTINTOS GOBIERNOS
TEMA 13 ESPAÑA EN DEMOCRACIA:DISTINTOS GOBIERNOS
 
Plan Refuerzo Escolar 2024 para estudiantes con necesidades de Aprendizaje en...
Plan Refuerzo Escolar 2024 para estudiantes con necesidades de Aprendizaje en...Plan Refuerzo Escolar 2024 para estudiantes con necesidades de Aprendizaje en...
Plan Refuerzo Escolar 2024 para estudiantes con necesidades de Aprendizaje en...
 
ACERTIJO DE LA BANDERA OLÍMPICA CON ECUACIONES DE LA CIRCUNFERENCIA. Por JAVI...
ACERTIJO DE LA BANDERA OLÍMPICA CON ECUACIONES DE LA CIRCUNFERENCIA. Por JAVI...ACERTIJO DE LA BANDERA OLÍMPICA CON ECUACIONES DE LA CIRCUNFERENCIA. Por JAVI...
ACERTIJO DE LA BANDERA OLÍMPICA CON ECUACIONES DE LA CIRCUNFERENCIA. Por JAVI...
 
Sesión de clase: Defendamos la verdad.pdf
Sesión de clase: Defendamos la verdad.pdfSesión de clase: Defendamos la verdad.pdf
Sesión de clase: Defendamos la verdad.pdf
 
Power Point: Fe contra todo pronóstico.pptx
Power Point: Fe contra todo pronóstico.pptxPower Point: Fe contra todo pronóstico.pptx
Power Point: Fe contra todo pronóstico.pptx
 
proyecto de mayo inicial 5 añitos aprender es bueno para tu niño
proyecto de mayo inicial 5 añitos aprender es bueno para tu niñoproyecto de mayo inicial 5 añitos aprender es bueno para tu niño
proyecto de mayo inicial 5 añitos aprender es bueno para tu niño
 

Código formularios1

  • 3. REGISTRO DE CLIENTES CÓDIGOFORMULARIOS AGREGAR Option Explicit Dim ArchivoIMG As String Private Sub cmd_Agregar_Click() Dim i As Integer If cbo_Nombre.Text= "" Then MsgBox"Nombre inválido",vbInformation+ vbOKOnly cbo_Nombre.SetFocus ExitSub End If If Not (Mid(cbo_Nombre.Text,1,1) Like "[a-z]" OrMid(cbo_Nombre.Text,1,1) Like "[A-Z]") Then MsgBox "Nombre inválido",vbInformation+ vbOKOnly cbo_Nombre.SetFocus ExitSub End If
  • 4. REGISTRO DE CLIENTES For i = 2 To Len(cbo_Nombre.Text) IfMid(cbo_Nombre.Text,i,1) Like "#" Then MsgBox "Nombre inválido",vbInformation+ vbOKOnly cbo_Nombre.SetFocus Exit Sub End If Next Sheets("Clientes").Activate Dim fCliente AsInteger fCliente = nCliente(cbo_Nombre.Text) If fCliente =0 Then Do While NotIsEmpty(ActiveCell) ActiveCell.Offset(1,0).Activate ' si el registro no existe,se va al final. Loop
  • 5. REGISTRO DE CLIENTES Else Cells(fCliente,1).Select ' cuando ya existe el registro,cumple esta condición. End If 'Aqui es cuando agregamos o modificamosel registro Application.ScreenUpdating=False ActiveCell = cbo_Nombre ActiveCell.Offset(0,1) = txt_Direccion ActiveCell.Offset(0,2) = txt_Telefono ActiveCell.Offset(0,3) = txt_ID ActiveCell.Offset(0,4) = txt_Email ActiveCell.Offset(0,5) = ArchivoIMG txt_Direccion= Empty txt_Telefono= Empty txt_ID = Empty txt_Email = Empty cbo_Nombre = Empty
  • 6. REGISTRO DE CLIENTES Application.ScreenUpdating = True cbo_Nombre.SetFocus End Sub ELIMINAR Private Subcmd_Eliminar_Click() Dim fCliente AsInteger fCliente= nCliente(cbo_Nombre.Text) If fCliente=0 Then MsgBox "El cliente que ustedquiere eliminarnoexiste",vbInformation+vbOKOnly cbo_Nombre.SetFocus ExitSub End If
  • 7. REGISTRO DE CLIENTES If MsgBox("¿Seguroque quiere eliminareste cliente?",vbQuestion+vbYesNo) =vbYesThen Cells(fCliente,1).Select ActiveCell.EntireRow.Delete MsgBox "Cliente eliminado", vbInformation+vbOKOnly cbo_Nombre.SetFocus End If End Sub CERRAR Private Subcmd_Cerrar_Click() End End Sub COMBOBOX o CUADRO COMBINADO cbo_Nombre Private Subcbo_Nombre_Change() On Error Resume Next
  • 8. REGISTRO DE CLIENTES If nCliente(cbo_Nombre.Text) <>0 Then Sheets("Clientes").Activate Cells(cbo_Nombre.ListIndex +2, 1).Select txt_Direccion=ActiveCell.Offset(0,1) txt_Telefono=ActiveCell.Offset(0,2) txt_ID = ActiveCell.Offset(0,3) txt_Email = ActiveCell.Offset(0,4) fotografia.Picture =LoadPicture("") fotografia.Picture =LoadPicture(ActiveCell.Offset(0,5)) ArchivoIMG= ActiveCell.Offset(0,5) Else
  • 9. REGISTRO DE CLIENTES txt_Direccion="" txt_Telefono = "" txt_ID = "" txt_Email = "" ArchivoIMG= "" fotografia.Picture = LoadPicture("") End If End Sub Private Subcbo_Nombre_Enter() CargarLista End SubSub CargarLista() cbo_Nombre.Clear Sheets("Clientes").Select Range("A2").Select Do While Not IsEmpty(ActiveCell) cbo_Nombre.AddItemActiveCell.Value ActiveCell.Offset(1,0).Select Loop
  • 10. REGISTRO DE CLIENTES End Sub SubLimpiarFormulario() CargarLista cbo_Nombre = "" txt_Direccion="" txt_Telefono="" txt_ID = "" txt_Email = "" ArchivoIMG= "" End Sub cmd_Imagen Private Sub cmd_Imagen_Click() On Error Resume Next ArchivoIMG = Application.GetOpenFilename("Imágenes jpg,*.jpg,Imágenes bmp,*.bmp", 0, "Seleccionar Imágen para Reegistro de Clientes")
  • 11. REGISTRO DE CLIENTES fotografia.Picture = LoadPicture("") fotografia.Picture = LoadPicture(ArchivoIMG) End Sub MÓDULO 1 Option Explicit Sub registrar() Load frm_Clientes Sheets("clientes").Activate frm_Clientes.Show End Sub Function nCliente(nombre As String) As Integer Application.ScreenUpdating = False Sheets("Clientes").Activate Range("A2").Activate
  • 12. REGISTRO DE CLIENTES nCliente = 0 Do While Not IsEmpty(ActiveCell) If nombre = ActiveCell Then nCliente = ActiveCell.Row End If ActiveCell.Offset(1, 0).Select Loop Application.ScreenUpdating = True End Function