Posts by homegrownandy

    thanks for the reply, I dont believe I can do that.



    so its this line:


    Code
    With objWord.ActiveDocument.Bookmarks("RISKS").Range.Characters.Last.Next.PasteAppendTable


    I can look at other paste options but this is pasting into a table and other options have formatting issues. What do you think?


    Andy.


    Update:


    If you don't think there's a "one line" solution here I could add code that copies this data to a new sheet first and then carries on with the rest of the code.

    Im running this code from a microsoft access application with the intent to run an existing macro within the opened document.


    The document does open but i get the error:


    run-time error '1004': Cannot run the macro "ExcelDataToWord". The macro may not be available in this workbook or all macros may be disabled.


    Note: this macro is contained in the "this workbook" section. I'm probbaly not referencing it properly, Any help appreciated.



    Thanks,
    Andy

    Im using this line of code in some VBA to copy rows with data in them:


    Code
    lngLastRow = Sheets("RISKS").Range("A65535").End(xlUp).Row


    The problem is that these cells, although blank, contain formulas. How can I stop these being copied?


    Thanks in advance,


    Andy

    It is a requirement for this code to run to have the following option enabled in word:


    smart cut and paste enabled.
    Adjust table formatting and alignment on paste enabled.


    However, the table im pasting into then goes half way off the screen.


    Currently trouble shooting, Ill make a new post if i need help as its a different issue. But if anyone else has a similar problem it may help.

    It has to be paste append, the information is from access but I have a lot of formatting errors when pasting from access. When using excel this DID work.


    Thanks for your suggestions,


    The data to be pasted in had one less column or a blank column. This was causing the error.


    I wouldnt have had a clue where to start without your input so again, Thanks a lot.

    Sorry and thanks for the tip there.


    you were correct it is on this line:


    Code
    With objWord.ActiveDocument.Bookmarks("RISKS").Range.Characters.Last.Next.PasteAppendTable


    [ATTACH=JSON]{"data-align":"none","data-size":"full","title":"Screenshot_2.png","data-attachmentid":1207067}[/ATTACH]


    Maybe the document isnt "active" when im in excel? I dont know why it was working previously though.

    Thank you for the reply,
    I have annotated the slashes out of the code which does now open the document. Thank you for that. I still get the error: this command is not available.

    I have this code working in parts but not together. I can pen a word document using the top part and I can insert to a table using the bottom part (but not using file select I have to define the document path.)


    When I put these together I get type mismatch. Any ideas why?


    Type mismatch happens once i select the word document.


    I'm trying to adapt some code I found online to no avail:



    Code
    Sub MergingCells()
    For i = 2 To Range("c3:c200").End(xlDown).Row
    Sheets("ADMIN").Hyperlinks.Add anchor:=Cells(i, 3), Address:=Cells(i, 2).Value, TextToDisplay:=Cells(i, 1).Value
    Next i
    End Sub


    the sheet is called admin.
    c3:c200 = the "friendly name"
    D3:d200 = URL
    e3:e200 = Output (none currently)


    When clicked it looks like tis doing something (loading symbol) but nothing changes. Is there anything obviously wrong here?


    Andy

    I'm using the following function: =HYPERLINK(M7, N7)


    this will take a link in M7 ad give it a friendly name from N7. That's great but I want to remove M7 and N7 and leave a text hyperlink in place of this formula.


    I've seen suggestions saying to paste special and use HTML. This option is not available (been looking into this and I see no solution)


    Could anyone recommend a way to achieve this?


    Thanks in advance.

    I know what i want to achieve, I probably know how to do most of it myself too. Im just after some design advice before I begin. This is for a profit loss sheet for trading crypto currency.


    On the final design I want a summary page that will show % profit/loss for each coin, then at the end a total. Possible in the future to link to the API for live data but historical will be ok for now.


    I imagine (unless told otherwise) all coins would have to be kept on a seperate page/sheet? Prehaps some VBA that moves the coin to the right page on import, or creates it if needed.


    Each "trade" listed will have a unique reference number. This should be checked on import to avoid duplicates. As they are moved, the qualtity on any order that is "buy" should have a negatiive value (basically add - before the number) so the figure is calculated correctly.


    Im just wondering if someone could offer some feedback and possibly help with the code.


    Andy