Hello,
Trying to import over an excel spreadsheet with a module but the module needs some tweaking. What do I need to do with this example in order for it to work in Calc?
Thank you,
Cherkey
With Worksheets("sheet1").Columns("A:A")
.Find( _
what:="", _
after:=.Cells(ActiveCell.Row)).Activate
.Cells(ActiveCell.Row) = (partnumber)
End With
Find Cell, Activate Cell
Re: Find Cell, Activate Cell
Moving to Macros and UNO APIForum rules
For sharing working examples of macros / scripts. These can be in any script language supported by OpenOffice.org [Basic, Python, Netbean] or as source code files in Java or C# even - but requires the actual source code listing. This forum is not for asking questions about writing your own macros.
James
www.8daysaweek.co.uk - A User-Focused OOo site.
Windows Easy Installation CDs & OOo on USB Keys, OOo for Mac OS X + Ubuntu CDs
Please read: Survival Guide for the forum
OOo 3.1.1 on Ubuntu 9.x + Windows XPP, Mac OS X
www.8daysaweek.co.uk - A User-Focused OOo site.
Windows Easy Installation CDs & OOo on USB Keys, OOo for Mac OS X + Ubuntu CDs
Please read: Survival Guide for the forum
OOo 3.1.1 on Ubuntu 9.x + Windows XPP, Mac OS X
Re: Find Cell, Activate Cell
This is more difficult in OOo. I do not know what this macro does in VB, so it is difficult to translate, but I can make a few guesses.cherkey wrote:Hello,
Trying to import over an excel spreadsheet with a module but the module needs some tweaking. What do I need to do with this example in order for it to work in Calc?
Thank you,
Cherkey
With Worksheets("sheet1").Columns("A:A")
.Find( _
what:="", _
after:=.Cells(ActiveCell.Row)).Activate
.Cells(ActiveCell.Row) = (partnumber)
End With
Get Sheet1.
Code: Select all
Dim oSheet
oSheet = ThisComponent.getSheets().getByName("sheet1")
If you download AndrewMacro.odt, you can see things such as how to obtain the current cell (search for "get the active cell").
It looks like perhaps you are looking for the last used row in column A and setting the value to "part number"
I think if you look at "Which cells are used in a sheet?", you can use that on a column to determine the extent of a column if you desire.
Just a few pointers, but I must be off to bed...
Re: Find Cell, Activate Cell
Jump to next cell in column A where this row's value in A is found:
Cell X2 where X is any free column:
copy down and click the hyperlinks.
Cell X2 where X is any free column:
Code: Select all
=HYPERLINK("#"&ADDRESS(ROW()+MATCH($A2;$A3:$A$65536;0);1);"Next "&$A2)
Please, edit this topic's initial post and add "[Solved]" to the subject line if your problem has been solved.
Ubuntu 18.04 with LibreOffice 6.0, latest OpenOffice and LibreOffice
Ubuntu 18.04 with LibreOffice 6.0, latest OpenOffice and LibreOffice