Ask Your Question
0

Macro VBA excel to calc

asked 2018-01-31 12:03:06 +0100

kimal73 gravatar image

updated 2020-10-28 01:23:07 +0100

Alex Kemp gravatar image
 Sub vallerH24()
'
' valler Macro
'
' Keyboard Shortcut: Ctrl+Shift+I
     Range("C5").Select
     Selection.Copy
     lMaxRows = Cells(Rows.Count, "G").End(xlUp).Row
    Range("G" & lMaxRows + 1).Select
     Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
        :=False, Transpose:=False
Application.OnTime Now + TimeValue("00:02:00"), "vallerH24"
End Sub
Sub ripeti()
Application.OnTime Now + TimeValue("00:02:00"), "vallerH24"
End Sub

Hello, unfortunately I come from excell microsoft. I have decided not to use it anymore because it is really too heavy. I had created a working macro where I copied a value under a busy column. And gradually more and more below. all this had to happen at a certain time.

I was convinced that the language between the two programs was compatible. instead no.

this is my macro. Anyone can help me?? Thank you

edit retag flag offensive close merge delete

1 Answer

Sort by » oldest newest most voted
2

answered 2018-01-31 15:47:52 +0100

Jim K gravatar image

updated 2018-01-31 15:53:40 +0100

Use APSO to enter this Python code.

from threading import Timer

def append_to_column():
    oSheet = XSCRIPTCONTEXT.getDocument().getSheets().getByIndex(0)
    oColumns = oSheet.getColumns()
    COLUMN_G = ord('G') - ord('A')
    oColumn = oColumns.getByIndex(COLUMN_G)
    oFinder = oColumn.createSearchDescriptor()
    oFinder.SearchRegularExpression = True
    oFinder.SearchString = "."  # match cells that have something in them
    oResult = oColumn.findAll(oFinder)
    if oResult:
        sRange = oResult.AbsoluteName
        last_filled_row = int(sRange.rsplit("$", 1)[1])
    else:
        last_filled_row = 0
    new_row = str(last_filled_row + 1)
    cell_to = oSheet.getCellRangeByName("G" + new_row)
    cell_from = oSheet.getCellRangeByName("C5")
    cell_to.setString(cell_from.getString())
    t = Timer(120.0, append_to_column)
    t.start()

g_exportedScripts = append_to_column,

References:

edit flag offensive delete link more
Login/Signup to Answer

Question Tools

1 follower

Stats

Asked: 2018-01-31 12:03:06 +0100

Seen: 799 times

Last updated: Oct 28 '20