Find first empty row

Hope you will have success with your next question. And if I get a new idea , I won’t hide it from you.

Hi Lupp. I need to share this with you since you have been such a hugh help and I don’t want you’re expertise and contributions to go unnoticed.

I stepped away from this for awhile and came back to it with a clearer mind today. It was obvious the macro did not like the URL, the error message was clear on that. Didn’t have the presence of mind yesterday to go to the file and get the windows path by shift/right-click and copy. At comment limit and will add another comment.

After getting the windows path and comparing it to the physical path I noticed a difference shown below. I immediately placed it in the function you shared with me and it launched the summary.ods file. Sorry to have caused you frustration, it’s the last thing I wanted. If it’s any consolation I’ve probably knocked time off my life in pursuit of this.

Thanks again Lupp.

Original: c:/Users/computer%20one/My%20Documents/Summary.ods
Windows: "c:\Users\computer one\Documents\Summary.ods

Don’t worry too much. I should have mentioned in my respective comment above that I never saw a “My Documents” folder on a recent Windows system instead of whining. After all I was aware of that strangeness. (However, I am 73 and there may not be too much time left.)
Hoping you got everything now. But don’t hesitate to come back if necessary.

Thanks Lupp

You’re alright in my book. I am turning 55 this year. I hope you have many more prosperous years.

Thank you for extending the offer if I get stumped moving the ball on the remainder of this effort.

Mark,
To preface this, the content is being copied to a new sheet (with a button). I can address it after getting the dynamic row location remedied.

When running this as its on sub (at the bottom of my original code) it errors on this line.
Dim oColumn As Object : oColumn = oSheet.Columns.getByIndex( iColumnIndex )

As a test I replaced (iColumnIndex) with (cColumnIndex) to see its results. It doesn’t error with (cColumnIndex) but the active cell ends up at the very bottom of the sheets “a” column.

I know little of the macros’s, mainly “record macro”! But my test, and how I use it, is where ever active cell is, it will go to bottom of column and activates the empty cell, under the last cell with data in it. On what ever sheet I have it on! Your welcome to look at it! Its a lot, but sub is at top, but not in Basic, I hide it on a hidden sheet, names Macro1, because if I share it, it give warnings about Macros if it is in a Modules, so paste to module . https://goo.gl/5zwX

Thank you Mark but the link is not resolving.

Sorry about that. This should work. https://goo.gl/aLkBSe
Or. https://drive.google.com/file/d/1pY0iqJ0dBaNrr4Ybrx4exTJ6lzJrvOLi/view?usp=sharing

Mark, I am tired and made an off the cuff request (below) , Please disregard. I am now sifting through the macros. Thank you.

Thank you Mark. Can you steer me to a sheet in your fie where I can see what we’ve been discussing in action?

My Macros, are not working till installed, making the file safe. There Hidden! R. click on any sheets tab at bottom. click “show sheet”. open “Macro1”, sheet. the sub is top one! To install them, Copy & paste. I put directions at the top of that “Macro1” sheet. It was not off cuff. I like helping.

This one has macros on so buttons will work, not sure if it will down load, that’s why I hid macro’s
cause i had trouble downloading with macros on file. Also sheets are locked but no password needed, just r. click on tab to unlock. https://goo.gl/3zHbEB

Use
If IsMissing(pSheetN) Then pSheetN = ThisComponent.CurrentController.ActiveSheet.RangeAddress.Sheet + 1
to make the functions applicable to the active sheet
and make the parameter pEvent of gF() and gL() Optional if you intend to call the Sub not exclusively by an event, but via Tools > Macros > Run probably.
Also note that the calling by a mousebutton_release is primitive and does not check if th release was inside the button. (AndSoOn)

I had same problem. I found answer here, somewhere, from a question another ask. It has worked well for me by running it at end of sub by the call command. call Last_Cell_in_Column
I’ve no clue what all the sub is doing, saying, but it works!

Sub Last_Cell_in_Column( Optional iColumnIndex )
REM Moves the cell cursor to 1 cell below the last used Cell in the specified Column in the Active Sheet.
REM <iColumnIndex> : Zero-based index of the Column whose cell should be selected; Leave empty for the Current column.
    Dim oDoc As Object      : oDoc    = ThisComponent
    If IsMissing( iColumnIndex ) Then iColumnIndex = oDoc.CurrentSelection.RangeAddress.StartColumn
    Dim oSheet As Object    : oSheet  = oDoc.CurrentController.ActiveSheet
    Dim oColumn As Object   : oColumn = oSheet.Columns.getByIndex( iColumnIndex )
    Dim oRanges As Object   : oRanges = oColumn.queryContentCells( 1023 )   REM Any content.
    Dim lRow As Long
    Dim lCount As Long      : lCount  = oRanges.getCount()
dim document   as object
dim dispatcher as object
dispatcher = createUnoService("com.sun.star.frame.DispatchHelper")
    If lCount > 0 Then        lRow    = oRanges.getByIndex( lCount - 1 ).RangeAddress.EndRow + 1
    Dim oCell As Object     : oCell   = oColumn.getCellByPosition( 0, lRow )
    oDoc.CurrentController.select( oCell )
End Sub

@Goc2 I change the above, took out My sheet name. I tested It again, it worked ok for me.

@Mark-McLean - If you select your whole code-block, and then click the 101/010 button in the Markdown toolbar, it will format properly as code. Thanks!

Thank you Mark. I will apply this and evaluate the results.

Thanks @dajare! I wondered why it looked so odd. I’m on a dell e6420, windows 10, LO 6.0. If above needs correction or info, let me know. Again Thanks

@mark-mclean Looks like you cracked the formatting. Takes a while to work out some of these tricks!