Write in two ways to two different worksheets

  • 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


    Code
    1. Set wsAE = Worksheets("Sheet5")
    2. If MsgBox("Entrada correcta?", vbYesNo + vbQuestion, "Verificar los datos!") = vbNo Then Exit Sub
    3. iRow = wsAE.Cells.Find(What:="*", SearchOrder:=xlRows, SearchDirection:=xlPrevious, LookIn:=xlValues).Row + 1
    4. wsAE.Cells(iRow, 1).Resize(, 20).Value = Array(CMBCLIENT.Value, CMBPRESTADORA.Value, CMBDESPERSIONES.Value, CMBCONCEPTO.Value, CMBCOMISON.Value, cmbcosto.Value, CMBTIPO.Value, _
    5. CMBEMPRESA.Value, CMBIVA.Value, TXTIMPORTE.Value, TXTIMPORTEBRUTO.Value, TXTFECHA.Value, TXTSUMCOM.Value, TXTSUBTOTAL.Value, TXTSUMIVA.Value, TXTSUMFACT.Value, TXTPAGOCLIENTE.Value, _
    6. 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 X(

  • 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

    Code
    1. lastcol = Cells(1, Columns.Count).End(xlToLeft).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

  • So finaly i have it so far that i am writing in the correct order, but it does not goes to the new column.....


  • dangelor Thank you for the support, you pointed me to the correct direction!


    I mannaged to fix it


    So this one is solved!