Untitled

mail@pastecode.io avatar
unknown
plain_text
a month ago
697 B
0
Indexable
Never
Sub CreateAudiogramChart()
    Dim doc As Document
    Set doc = ActiveDocument
    
    ' Create a table with 13 rows and 9 columns
    Dim tbl As Table
    Set tbl = doc.Tables.Add(Range:=Selection.Range, NumRows:=13, NumColumns:=9)
    
    ' Set the width for columns
    Dim i As Integer
    For i = 1 To 9
        tbl.Columns(i).Width = InchesToPoints(0.75)
    Next i
    
    ' Merge cells for the labels
    tbl.Cell(1, 1).Merge MergeTo:=tbl.Cell(1, 8)
    tbl.Cell(1, 1).Range.Text = "Hearing Level (dB)"
    
    tbl.Cell(13, 1).Merge MergeTo:=tbl.Cell(13, 8)
    tbl.Cell(13, 1).Range.Text = "Frequency (Hz)"
    
    ' Insert frequency labels
    tbl.Cell(13, 
Leave a Comment