mi macro no suma, ni saca los resultados

07/09/2006 - 17:20 por tere | Informe spam
Hice una macro que cuando la corro no me saca los resultados del
Textbox6 y TextBoxt7, los resultados de estos textBox es la suma:

TextBox6 = (TextBox8) + (TextBox9) + (TextBox10) + (TextBox11) +
(TextBox12) + (TextBox13) + (TextBox14)

TextBox7 = (TextBox8) + (TextBox9) + (TextBox10) + (TextBox13) +
(TextBox14)

Me parece que me falto algo. Pego mi programa para que lo vean

Gracias

Private Sub CommandButton1_Click()
Cells.Find(What:=TextBox1, After:=ActiveCell, LookIn:=xlFormulas,
LookAt _
:=xlPart, SearchOrder:=xlByRows, SearchDirection:=xlNext,
MatchCase:= _
False).Activate

ActiveCell.Offset(0, 1).Select
TextBox2 = ActiveCell

ActiveCell.Offset(0, 1).Select
TextBox3 = ActiveCell

ActiveCell.Offset(0, 1).Select
TextBox4 = ActiveCell

ActiveCell.Offset(0, 1).Select
TextBox5 = ActiveCell

ActiveCell.Offset(0, 1).Select
TextBox6 = ActiveCell

ActiveCell.Offset(0, 1).Select
TextBox7 = ActiveCell

ActiveCell.Offset(0, 1).Select
TextBox8 = ActiveCell

ActiveCell.Offset(0, 1).Select
TextBox9 = ActiveCell

ActiveCell.Offset(0, 1).Select
TextBox10 = ActiveCell

ActiveCell.Offset(0, 1).Select
TextBox11 = ActiveCell

ActiveCell.Offset(0, 1).Select
TextBox12 = ActiveCell

ActiveCell.Offset(0, 1).Select
TextBox13 = ActiveCell

ActiveCell.Offset(0, 1).Select
TextBox14 = ActiveCell
End Sub

Private Sub CommandButton2_Click()
Selection.EntireRow.Delete
Range("B4").Select
TextBox1 = Empty
TextBox2 = Empty
TextBox3 = Empty
TextBox4 = Empty
TextBox5 = Empty
TextBox6 = Empty
TextBox7 = Empty
TextBox8 = Empty
TextBox9 = Empty
TextBox10 = Empty
TextBox11 = Empty
TextBox12 = Empty
TextBox13 = Empty
TextBox14 = Empty
TextBox1.SetFocus
End Sub

Private Sub CommandButton3_Click()
Range("B4").Select
Selection.EntireRow.Insert
TextBox1 = Empty
TextBox2 = Empty
TextBox3 = Empty
TextBox4 = Empty
TextBox5 = Empty
TextBox6 = Empty
TextBox7 = Empty
TextBox8 = Empty
TextBox9 = Empty
TextBox10 = Empty
TextBox11 = Empty
TextBox12 = Empty
TextBox13 = Empty
TextBox14 = Empty
End Sub

Private Sub TextBox1_Change()
Range("B4").FormulaR1C1 = TextBox1
End Sub

Private Sub TextBox10_Change()
Range("K4").FormulaR1C1 = TextBox10
End Sub

Private Sub TextBox11_Change()
Range("L4").FormulaR1C1 = TextBox11
End Sub

Private Sub TextBox12_Change()
Range("M4").FormulaR1C1 = TextBox12
End Sub

Private Sub TextBox13_Change()
Range("N4").FormulaR1C1 = TextBox13
End Sub

Private Sub TextBox14_Change()
Range("O4").FormulaR1C1 = TextBox14
End Sub

Private Sub TextBox2_Change()
Range("C4").FormulaR1C1 = TextBox2
End Sub

Private Sub TextBox3_Change()
Range("D4").FormulaR1C1 = TextBox3
End Sub

Private Sub TextBox4_Change()
Range("E4").FormulaR1C1 = TextBox4
End Sub

Private Sub TextBox5_Change()
Range("F4").FormulaR1C1 = TextBox5
End Sub

Private Sub TextBox6_Change()
Range("G4").FormulaR1C1 = TextBox6
ActiveCell.FormulaR1C1 = TextBox6
Rem aqui se crea la formula
TextBox6 = Val(TextBox8) + Val(TextBox9) + Val(TextBox10) +
Val(TextBox11) + Val(TextBox12) + Val(TextBox13) + Val(TextBox14)
End Sub

Private Sub TextBox7_Change()
Range("H4").FormulaR1C1 = TextBox7
ActiveCell.FormulaR1C1 = TextBox7
Rem aqui se crea la formula
TextBox7 = Val(TextBox8) + Val(TextBox9) + Val(TextBox10) +
Val(TextBox13) + Val(TextBox14)
End Sub

Private Sub TextBox8_Change()
Range("I4").FormulaR1C1 = TextBox8
End Sub

Private Sub TextBox9_Change()
Range("J4").FormulaR1C1 = TextBox9
End Sub
 

Leer las respuestas

#1 Gabriel Raigosa
30/09/2006 - 18:48 | Informe spam
Carpeta
Descripción
Dirección

1
** Microsoft Excel *
http://esnips.com/web/GabrielRaigosa

2
Archivos para usar en clase
http://esnips.com/web/RaigosaClase

3
Fechas y Horas
http://esnips.com/web/RaigosaFechasHoras

4
Formato y Formato Condicional
http://esnips.com/web/RaigosaFormatos

5
Foro Excel
http://esnips.com/web/ForoExcel

6
Funciones de Busqueda
http://esnips.com/web/RaigosaBusqueda

7
Funciones de Texto
http://esnips.com/web/RaigosaTexto

8
Funciones Financieras
http://esnips.com/web/RaigosaFinancieras

9
Funciones Logicas
http://esnips.com/web/RaigosaLogicas

10
Graficos con Excel
http://esnips.com/web/RaigosaGraficos

11
Grupo (Sabados)
Privado

12
Grupo (Viernes)
Privado

13
Grupo Excel Septiembre
Privado

14
Juegos con Excel
http://esnips.com/web/RaigosaJuegosExcel

15
Macros con Excel
http://esnips.com/web/Macros-con-Excel

16
Manuales Excel
http://esnips.com/web/RaigosaManuales

17
Paginas WEB
http://esnips.com/web/RaigosaPaginasExcel

18
Practicas - XLS
http://esnips.com/web/RaigosaPracticasXLS

19
Tablas Dinámicas
http://esnips.com/web/RaigosaTablasDinamicas

20
TEST
http://esnips.com/web/GabrielRaigosa-test

21
Validación
http://esnips.com/web/RaigosaValidacion

22
Varios
http://esnips.com/web/RaigosaVarios

23
VBA - Visual Basic para Aplicaciones
http://esnips.com/web/RaigosaVBA



Gabriel Raigosa
http://esnips.com/web/Raigosa
http://esnips.com/web/ForoExcel
"tere" escribió en el mensaje
news:
| Hice una macro que cuando la corro no me saca los resultados del
| Textbox6 y TextBoxt7, los resultados de estos textBox es la suma:
|
| TextBox6 = (TextBox8) + (TextBox9) + (TextBox10) + (TextBox11) +
| (TextBox12) + (TextBox13) + (TextBox14)
|
| TextBox7 = (TextBox8) + (TextBox9) + (TextBox10) + (TextBox13) +
| (TextBox14)
|
| Me parece que me falto algo. Pego mi programa para que lo vean
|
| Gracias
|
| Private Sub CommandButton1_Click()
| Cells.Find(What:=TextBox1, After:=ActiveCell, LookIn:=xlFormulas,
| LookAt _
| :=xlPart, SearchOrder:=xlByRows, SearchDirection:=xlNext,
| MatchCase:= _
| False).Activate
|
| ActiveCell.Offset(0, 1).Select
| TextBox2 = ActiveCell
|
| ActiveCell.Offset(0, 1).Select
| TextBox3 = ActiveCell
|
| ActiveCell.Offset(0, 1).Select
| TextBox4 = ActiveCell
|
| ActiveCell.Offset(0, 1).Select
| TextBox5 = ActiveCell
|
| ActiveCell.Offset(0, 1).Select
| TextBox6 = ActiveCell
|
| ActiveCell.Offset(0, 1).Select
| TextBox7 = ActiveCell
|
| ActiveCell.Offset(0, 1).Select
| TextBox8 = ActiveCell
|
| ActiveCell.Offset(0, 1).Select
| TextBox9 = ActiveCell
|
| ActiveCell.Offset(0, 1).Select
| TextBox10 = ActiveCell
|
| ActiveCell.Offset(0, 1).Select
| TextBox11 = ActiveCell
|
| ActiveCell.Offset(0, 1).Select
| TextBox12 = ActiveCell
|
| ActiveCell.Offset(0, 1).Select
| TextBox13 = ActiveCell
|
| ActiveCell.Offset(0, 1).Select
| TextBox14 = ActiveCell
| End Sub
|
| Private Sub CommandButton2_Click()
| Selection.EntireRow.Delete
| Range("B4").Select
| TextBox1 = Empty
| TextBox2 = Empty
| TextBox3 = Empty
| TextBox4 = Empty
| TextBox5 = Empty
| TextBox6 = Empty
| TextBox7 = Empty
| TextBox8 = Empty
| TextBox9 = Empty
| TextBox10 = Empty
| TextBox11 = Empty
| TextBox12 = Empty
| TextBox13 = Empty
| TextBox14 = Empty
| TextBox1.SetFocus
| End Sub
|
| Private Sub CommandButton3_Click()
| Range("B4").Select
| Selection.EntireRow.Insert
| TextBox1 = Empty
| TextBox2 = Empty
| TextBox3 = Empty
| TextBox4 = Empty
| TextBox5 = Empty
| TextBox6 = Empty
| TextBox7 = Empty
| TextBox8 = Empty
| TextBox9 = Empty
| TextBox10 = Empty
| TextBox11 = Empty
| TextBox12 = Empty
| TextBox13 = Empty
| TextBox14 = Empty
| End Sub
|
| Private Sub TextBox1_Change()
| Range("B4").FormulaR1C1 = TextBox1
| End Sub
|
| Private Sub TextBox10_Change()
| Range("K4").FormulaR1C1 = TextBox10
| End Sub
|
| Private Sub TextBox11_Change()
| Range("L4").FormulaR1C1 = TextBox11
| End Sub
|
| Private Sub TextBox12_Change()
| Range("M4").FormulaR1C1 = TextBox12
| End Sub
|
| Private Sub TextBox13_Change()
| Range("N4").FormulaR1C1 = TextBox13
| End Sub
|
| Private Sub TextBox14_Change()
| Range("O4").FormulaR1C1 = TextBox14
| End Sub
|
| Private Sub TextBox2_Change()
| Range("C4").FormulaR1C1 = TextBox2
| End Sub
|
| Private Sub TextBox3_Change()
| Range("D4").FormulaR1C1 = TextBox3
| End Sub
|
| Private Sub TextBox4_Change()
| Range("E4").FormulaR1C1 = TextBox4
| End Sub
|
| Private Sub TextBox5_Change()
| Range("F4").FormulaR1C1 = TextBox5
| End Sub
|
| Private Sub TextBox6_Change()
| Range("G4").FormulaR1C1 = TextBox6
| ActiveCell.FormulaR1C1 = TextBox6
| Rem aqui se crea la formula
| TextBox6 = Val(TextBox8) + Val(TextBox9) + Val(TextBox10) +
| Val(TextBox11) + Val(TextBox12) + Val(TextBox13) + Val(TextBox14)
| End Sub
|
| Private Sub TextBox7_Change()
| Range("H4").FormulaR1C1 = TextBox7
| ActiveCell.FormulaR1C1 = TextBox7
| Rem aqui se crea la formula
| TextBox7 = Val(TextBox8) + Val(TextBox9) + Val(TextBox10) +
| Val(TextBox13) + Val(TextBox14)
| End Sub
|
| Private Sub TextBox8_Change()
| Range("I4").FormulaR1C1 = TextBox8
| End Sub
|
| Private Sub TextBox9_Change()
| Range("J4").FormulaR1C1 = TextBox9
| End Sub
|

Preguntas similares