Wednesday, June 25, 2025

Macro VBA script: Change 1st column width for all table

 Sub SetFirstColumnWidthInPicas()

    Dim tbl As Table

    Dim r As Long

    Dim desiredWidthPicas As Single

    Dim desiredWidthPoints As Single


    ' Set desired width in picas

    desiredWidthPicas = 30 ' ? Change this as needed

    desiredWidthPoints = desiredWidthPicas * 12 ' Convert picas to points


    For Each tbl In ActiveDocument.Tables

        With tbl

            For r = 1 To .Rows.Count

                On Error Resume Next ' In case cell doesn't exist (e.g. merged)

                With .cell(r, 1)

                    .Width = desiredWidthPoints

                End With

                On Error GoTo 0

            Next r

        End With

    Next tbl


    MsgBox "First column width updated to " & desiredWidthPicas & " picas.", vbInformation

End Sub

Macro VBA script: Change Font name and size in the 2nd column for all table

 Sub ChangeFontInSecondColumn()

    Dim tbl As Table

    Dim r As Long, c As Long

    Dim cell As cell

    Dim targetCol As Long

    Dim rng As Range

    

    targetCol = 2 ' Second column


    For Each tbl In ActiveDocument.Tables

        With tbl

            For r = 1 To .Rows.Count

                On Error Resume Next ' In case cell(2) doesn't exist in a row

                Set cell = .cell(r, targetCol)

                If Not cell Is Nothing Then

                    Set rng = cell.Range

                    rng.End = rng.End - 1 ' Exclude end-of-cell marker

                    With rng.Font

                        .Name = "STIX Two Text"

                        .Size = 10

                    End With

                End If

                Set cell = Nothing

                Set rng = Nothing

                On Error GoTo 0

            Next r

        End With

    Next tbl


    MsgBox "Font updated in second column of all tables.", vbInformation

End Sub

Monday, May 19, 2025

Word save to pdf, downloaded font not bold

I write a Word file using STIX Two Text, downloaded somewhere. After saving to PDF, the bold formatting is not saved in PDF version.

Solution: 

Try to save pdf using Print, choose Microsoft Print to PDF.

Sunday, April 13, 2025

Tilawah pembuka Halal bi Halal

Al-Hujurat 10 & 13

Al-Maidah 7-10

Tuesday, February 18, 2025

Word: How to prevent Update Fields when saving

Follow these steps:
1. Save your document.
2. Press Ctrl+A. This selects your entire document.
3. Press Ctrl+F11. This "locks" all fields, so they are not updated.
4. Print your document or convert it to a PDF file.
5. Close the document without saving

Note: To 'unclocks', press Ctrl+Shift+F11.

Sunday, January 26, 2025

Saya mengalami 'Word found unreadable content ...'

Ada file Microsoft Word tiba-tiba crash saat saya mengedit equation. Saya coba buka lagi, tidak bisa, dengnan pesan error "Word found unreadable content...."

Saya coba fitur 'Open and repair' tidak berhasil. Saya coba Open pakai 'Recover from any file' juga tidak berhasil. Saya coba ganti ekstensi ke .rtf juga tidak berhasil.

Setelah iseng saya buka pakai Google Drive document, ternyata berhasil terbuka. Saya edit sedikit lalu saya download lagi sebagai .docx.

[PROBLEM SOLVED]

Wednesday, November 27, 2024

Sistem koordinat posisi pesawat di Xplane

Umumnya, sistem koordinat posisi pesawat (X1 Y1 Z1) mewakili North-East-Down (NED).

Di Xplane, (X2 Y2 Z2) mewakili East-Up-South (EUS).

Jadi, konversi dari Xplane (EUS) ke NED adalah 

X1 = -Z2, Y1 = X2, Z1 = -Y2.

Monday, November 25, 2024

Low pass filter waktu diskrit dan kontinu

Transfer function Laplace (s) untuk low pass filter

G(s) = K/(1+Tc.s)

dimana K adalah gain filter, Tc adalah konstanta waktu filter, s adalah variabel Laplace.

Persamaan beda untuk low pass filter diskrit

x[n+1] = (1-Ts/Tc).x[n] + K.(Ts/Tc).u[n]

y[n] = x[n]

dimana Ts adalah time sampling, Tc adalah konstanta waktu filter (cut-off), K adalah gain filter, dan u[n] adalah sinyal input filter.

Low-Pass Filter (Discrete or Continuous)

Vektor gravitasi body frame (x y z)

Fgx = -mg sin(theta)

Fgy = mg sin(phi) cos(theta)

Fgz = mg cos(phi) cos(theta)

dimana phi dan theta adalah sudut roll dan sudut pitch.

Sunday, September 1, 2024

Mengapa berfikir keras terlalu lama melelahkan mental?

Berpikir keras selama beberapa jam dapat membuat kita merasa lelah secara mental – dan kini kita mungkin tahu alasannya. Konsentrasi yang berkepanjangan menyebabkan terbentuknya senyawa yang disebut glutamat di bagian depan otak.

“Salah satu cara untuk [mengurangi penumpukan glutamat] adalah dengan mengaktifkan korteks prefrontal lateral lebih sedikit saat memilih,” kata Wiehler. “Jika Anda melakukannya, Anda akan lebih sering memilih opsi yang menggoda.”

Why thinking hard for several hours can leave you mentally exhausted | New Scientist