How the peep i close this
Posts by Mildpower
-
-
dangelor Thank you for the support, you pointed me to the correct direction!
I mannaged to fix it
Code
Display MorePrivate Sub casa() Dim lColumn As Long Set sh = Worksheets("Tu Casa Express") lColumn = sh.Cells(6, Columns.Count).End(xlToLeft).Column + 1 Debug.Print lColumn sh.Cells(lColumn)(3).Value2 = CMBCLIENT.Value sh.Cells(lColumn)(4).Value2 = CMBPRESTADORA.Value sh.Cells(lColumn)(5).Value2 = CMBDESPERSIONES.Value sh.Cells(lColumn)(6).Value2 = CMBCONCEPTO.Value sh.Cells(lColumn)(7).Value2 = CMBTIPO.Value sh.Cells(lColumn)(8).Value2 = CMBEMPRESA.Value sh.Cells(lColumn)(9).Value2 = TXTFECHA.Value sh.Cells(lColumn)(10).Value2 = TXTIMPORTE.Value sh.Cells(lColumn)(11).Value2 = TXTSUMCOM.Value sh.Cells(lColumn)(12).Value2 = TXTSUBTOTAL.Value sh.Cells(lColumn)(13).Value2 = TXTSUMIVA.Value sh.Cells(lColumn)(14).Value2 = TXTSUMFACT.Value sh.Cells(lColumn)(15).Value2 = TXTSUMCOM2.Value sh.Cells(lColumn)(16).Value2 = TXTRETORNO.Value sh.Cells(lColumn)(17).Value2 = TXTREMANTE1.Value sh.Cells(lColumn)(18).Value2 = TXTSUMCOSTO.Value sh.Cells(lColumn)(19).Value2 = TXTREMANTE2.Value sh.Cells(lColumn)(20).Value2 = TXTCOSTOINTERNO.Value sh.Cells(lColumn)(21).Value2 = TXTREMANTE3.Value sh.Cells(lColumn)(22).Value2 = TXTSUMComisionista1.Value sh.Cells(lColumn)(23).Value2 = TXTSUMComisionista2.Value sh.Cells(lColumn)(24).Value2 = TXTSUMCOM3.Value sh.Cells(lColumn)(25).Value2 = TXTSUMYT.Value sh.Cells(lColumn)(26).Value2 = TXTSUMComisionista3.Value sh.Cells(lColumn)(27).Value2 = TXTSUMComisionista4.Value End Sub
So this one is solved!
-
So finaly i have it so far that i am writing in the correct order, but it does not goes to the new column.....
Code
Display MorePrivate Sub CMB_addnew_Click() Dim lColumn As Long Dim sh As Worksheet Set sh = ThisWorkbook.Worksheets("AOM") TXTIMPORTE.Value = Val(TXTIMPORTEBRUTO.Value) / 1.16 TXTSUMCOM.Value = Val(TXTIMPORTE.Value) * Val(CMBCOMISON.Value) TXTSUBTOTAL.Value = Val(TXTIMPORTE.Value) + Val(TXTSUMCOM.Value) TXTSUMIVA.Value = Val(TXTSUBTOTAL.Value) * Val(CMBIVA.Value) TXTSUMFACT.Value = Val(TXTSUBTOTAL.Value) + Val(TXTSUMIVA.Value) TXTPAGOCLIENTE.Value = TXTIMPORTE.Value TXTSUMCOM2.Value = Val(TXTSUMFACT.Value) * Val(CMBCOMISION2.Value) TXTRETORNO.Value = Val(TXTSUMFACT.Value) - Val(TXTSUMCOM2.Value) TXTREMANTE1.Value = Val(TXTSUMFACT.Value) - Val(TXTRETORNO.Value) TXTSUMCOSTO.Value = Val(TXTSUMFACT.Value) * Val(CMBCOSTO.Value) TXTREMANTE2.Value = Val(TXTREMANTE1.Value) - Val(TXTSUMCOSTO.Value) TXTREMANTE3.Value = Val(TXTREMANTE2.Value) - Val(TXTCOSTOINTERNO.Value) TXTSUMComisionista1.Value = Val(TXTREMANTE3.Value) * Val(TXTComisionista1.Value) TXTSUMComisionista2.Value = Val(TXTREMANTE3.Value) * Val(TXTComisionista2.Value) TXTSUMCOM3.Value = Val(TXTSUMFACT.Value) * Val(CMBCOMISION3.Value) TXTSUMYT.Value = Val(TXTREMANTE3.Value) * Val(TXTYT.Value) TXTSUMComisionista3.Value = Val(TXTSUMComisionista1.Value) - Val(TXTSUMYT.Value) * Val(TXTComisionista1.Value) TXTSUMComisionista4.Value = Val(TXTSUMComisionista2.Value) - Val(TXTSUMYT.Value) * Val(TXTComisionista2.Value) lColumn = ActiveSheet.Cells(7, Columns.Count).End(xlToLeft).Column Sheet16.range("test").Cells(1).Value2 = TXTFECHA.Value Sheet16.range("test").Cells(2).Value2 = TXTIMPORTE.Value Sheet16.range("test").Cells(3).Value2 = TXTSUMCOM.Value Sheet16.range("test").Cells(4).Value2 = TXTSUBTOTAL.Value Sheet16.range("test").Cells(5).Value2 = TXTSUMIVA.Value Sheet16.range("test").Cells(6).Value2 = TXTSUMFACT.Value Sheet16.range("test").Cells(7).Value2 = TXTSUMCOM2.Value Sheet16.range("test").Cells(8).Value2 = TXTRETORNO.Value Sheet16.range("test").Cells(9).Value2 = TXTREMANTE1.Value Sheet16.range("test").Cells(10).Value2 = TXTSUMCOSTO.Value Sheet16.range("test").Cells(11).Value2 = TXTREMANTE2.Value Sheet16.range("test").Cells(12).Value2 = TXTCOSTOINTERNO.Value Sheet16.range("test").Cells(13).Value2 = TXTREMANTE3.Value Sheet16.range("test").Cells(15).Value2 = TXTSUMComisionista1.Value Sheet16.range("test").Cells(16).Value2 = TXTSUMComisionista2.Value Sheet16.range("test").Cells(17).Value2 = TXTSUMCOM3.Value Sheet16.range("test").Cells(18).Value2 = TXTSUMYT.Value Sheet16.range("test").Cells(19).Value2 = TXTSUMComisionista3.Value Sheet16.range("test").Cells(20).Value2 = TXTSUMComisionista4.Value 'Columns.AutoFit MsgBox "La nueva entrada ha sido guardada.", vbInformation, "Listo" 'Unload form TXTSUMComisionista1.Value = "" TXTSUMComisionista2.Value = "" TXTSUMCOM3.Value = "" TXTYT.Value = "" TXTSUMYT.Value = "" TXTSUMComisionista3.Value = "" TXTSUMComisionista4.Value = "" TXTREMANTE1.Value = "" TXTSUMCOSTO.Value = "" TXTCOSTOINTERNO.Value = "" TXTREMANTE2.Value = "" TXTSUMCOM2.Value = "" TXTRETORNO.Value = "" TXTSUMCOSTO.Value = "" TXTREMANTE3.Value = "" CMBIVA.Value = "" TXTIMPORTEBRUTO.Value = "" TXTIMPORTE.Value = "" TXTSUMCOM.Value = "" TXTSUBTOTAL.Value = "" TXTSUMIVA.Value = "" TXTSUMFACT.Value = "" TXTPAGOCLIENTE.Value = "" TXTFECHA.Value = "" CMBCLIENT.Value = "" CMBPRESTADORA.Value = "" CMBDESPERSIONES.Value = "" CMBCONCEPTO.Value = "" CMBTIPO.Value = "" CMBEMPRESA.Value = "" CMBCOMISON.Value = "" CMBCOSTO.Value = "" End Sub
-
Heu everything.
Maybe i have to aproach this different;
How can i find and write into the next blank column, from a form in Excel.
With this i can find the last column
But how can i address that:
txt.value goes to E7
txt2.value goes to E8
etc
And the next time it should go to
txt.value goes to F7
txt2.value goes to F8
etc
-
Hmm i am getting now a runtime error "1004"
-
All,
I hope you can help me with this.
I already have one part of the code ready, but i have to convert this part to also write in a different sheet and instead of horizontal it should be vertical
CodeSet wsAE = Worksheets("Sheet5") If MsgBox("Entrada correcta?", vbYesNo + vbQuestion, "Verificar los datos!") = vbNo Then Exit Sub iRow = wsAE.Cells.Find(What:="*", SearchOrder:=xlRows, SearchDirection:=xlPrevious, LookIn:=xlValues).Row + 1 wsAE.Cells(iRow, 1).Resize(, 20).Value = Array(CMBCLIENT.Value, CMBPRESTADORA.Value, CMBDESPERSIONES.Value, CMBCONCEPTO.Value, CMBCOMISON.Value, cmbcosto.Value, CMBTIPO.Value, _ CMBEMPRESA.Value, CMBIVA.Value, TXTIMPORTE.Value, TXTIMPORTEBRUTO.Value, TXTFECHA.Value, TXTSUMCOM.Value, TXTSUBTOTAL.Value, TXTSUMIVA.Value, TXTSUMFACT.Value, TXTPAGOCLIENTE.Value, _ TXTREMANTE1.Value, TXTSUMCOSTO.Value, TXTREMANTE2.Value)
I need to write this in a worksheet called AOM and the first empty cell is E7
Can somebody kick me to the correct direction, cause it is driving me nuts
-
Welcome to Ozgrid.
I would suggest before you do anything else that you tidy up your userform. You have controls overlapping each other so they cannot be seen or used.
Here's an example to filter a ListBox
First off all, thank you your help.
So sad that i cannot see the example that you mention
Second of all, what would you suggest to clean or improve in the script.
We have two kinds of transactions new and change.
-
All,
I am new to this forum.
I have a script for data entry with two buttons new entry and change entry.
For the last one, i am looking to create a automatic filter based on a combobox.
The data is based in one worksheet, so when you want to change data you can select the transaction in the Listbox. But in there i want the filter that is generated by the Combobox.
This is the Command for changing data
Code
Display MorePrivate Sub CMB_change_Click() Set wsAE = Worksheets("ADD-EXTEND") Set Rng = wsAE.Range("A2:A" & wsAE.Cells(Rows.Count, "A").End(xlUp).Row) Set fnd = Rng.Find(What:=C_02.Value, LookIn:=xlValues, Lookat:=xlWhole) If LB_01.ListIndex = -1 Then MsgBox "First choose a item in the list!", vbCritical, "Attention!" Exit Sub Else If T_id = vbNullString Then MsgBox "Customizing is not possible, no entries found", vbExclamation, "Attention!" Exit Sub ElseIf Not fnd Is Nothing Then Application.EnableEvents = True If MsgBox("Correct entry?", vbYesNo + vbQuestion, "Check the data!") = vbNo Then Exit Sub wsAE.Cells(iRow, 1).Resize(, 13).Value = Array(T_id.Value, C_02.Value, T_02.Value, _ T_01.Value, T_18.Value, T_21.Value, T_22.Value, T_12.Value, C_05.Value, t_09.Value, , T_04.Value, T_03.Value) 'Columns.AutoFit MsgBox "The changes have been saved.", vbInformation, "Done" Application.EnableEvents = True End If For Each Ctrl In Controls If TypeName(Ctrl) = "TextBox" Or TypeName(Ctrl) = "ComboBox" Then Ctrl.Value = "" Next Ctrl LB_01.ListIndex = -1 LB_01.TopIndex = 0 Call UserForm_Initialize End If End Sub
In here is mentioned where the listbox data is coming from
Code
Display MorePrivate Sub LB_01_Click() C_02.Value = LB_01.Column(1) T_02.Value = LB_01.Column(2) T_01.Value = LB_01.Column(3) T_12.Value = LB_01.Column(7) C_05.Value = LB_01.Column(8) T_04.Value = LB_01.Column(9) T_03.Value = LB_01.Column(10) t_09.Value = LB_01.Column(11) T_18.Value = LB_01.Column(4) T_21.Value = LB_01.Column(5) T_22.Value = LB_01.Column(6) End Sub Private Sub UserForm_Initialize() T_id.Value = WorksheetFunction.Max([ids]) + 1 LB_01.List = Sheets("ADD-EXTEND").Range("A:N").Value C_02.List = [datalist].Value C_05.List = [BUoM].Value t_09.List = Sheets("SALDOFINALPIVOT").Range("A:B").Value T_01.Value = Now ThisWorkbook.RefreshAll End Sub