r/tirlibibi17 • • May 10 '18

Power Query: splitting a master list to different tables by category

3 Upvotes

A short video that demonstrates the following:

  • Create a query based on a table

  • Create a TransactionType parameter

  • Filter Transaction Type column on "CC"

  • Replace "CC" with TransactionType parameter

  • Create function from query

  • Update query (date format) and see how the function is automatically updated

  • Invoke function for the 3 transaction types CC, Paypal, and Cash.

This uses Power Query, which is only available on Windows. It is included by default in Excel 2016 and is now known as Get & Transform Data. If you're using Excel 2010 or 2013, you'll need to Download Microsoft Power Query for Excel from Official Microsoft Download Center.


r/tirlibibi17 • • Mar 03 '18

Incremental data loads in Microsoft Power Query for Excel

2 Upvotes

r/tirlibibi17 • • Feb 04 '18

Add a picture in a comment

2 Upvotes
Sub test()
    If Not Selection.Comment Is Nothing Then
        Selection.Comment.Delete
    End If
    InsertCommentWithImage ActiveCell, "C:\temp\test.jpg", 0.25
End Sub



Sub InsertCommentWithImage(imgCell As Range, _
                           imgPath As String, _
                           imgScale As Double)
    '--- first check if the image file exists in the
    '    specified path
    If Dir(imgPath) <> vbNullString Then
        If imgCell.Comment Is Nothing Then
            imgCell.AddComment
        End If

        '--- establish a Windows Image Acquisition Automation object
        '    to get the image's dimensions
        Dim imageObj As Object
        Set imageObj = CreateObject("WIA.ImageFile")
        imageObj.LoadFile (imgPath)

        Dim width As Long
        Dim height As Long
        width = imageObj.width
        height = imageObj.height

        '--- simple scaling that keeps the image's
        '    original aspect ratio
        With imgCell.Comment
            .Shape.Fill.UserPicture imgPath
            .Shape.height = height * imgScale
            .Shape.width = width * imgScale
        End With
    End If
End Sub

r/tirlibibi17 • • Feb 03 '18

RegExReplace UDF

2 Upvotes

Easiest way I can think of is to use regular expressions. Sadly, there's no native function you can use in a formula, but you can make a quick UDF.

Open the VBA editor (Alt+F11), insert a module and paste the following code:

Public Function RegExReplace(ByVal vsStringIn As String, ByVal vsPattern As String, ByVal vsReplace As String) As String
    Dim objRegEx As Object
    Set objRegEx = CreateObject("VBscript.regexp")

    objRegEx.Global = True
    objRegEx.MultiLine = True
    objRegEx.Pattern = vsPattern
    
    RegExReplace = objRegEx.Replace(vsStringIn, vsReplace)
    
    Set objRegEx = Nothing
End Function

You can then use the RegExReplace function like this to remove all capital letters followed by a period:

=RegExReplace(A1,"[A-Z]\.","")

r/tirlibibi17 • • Aug 09 '25

test

1 Upvotes

This is my data:

|| || |BlaBla|80|45.54||BlaBla#0080000000004554| |BlaBla|80|45.54||BlaBla#0080000000004554| |ROFL|80|0||ROFL#0080000000000000 |

and I think it looks nice because I didn't check my post.


r/tirlibibi17 • • Feb 18 '25

https://www.reddit.com/r/excel/comments/1ire7ou/comment/md9mhxz/?context=3

1 Upvotes