วันพฤหัสบดีที่ 15 ธันวาคม พ.ศ. 2559

Excel : เอาข้อความในเซลล์มาต่อกัน

วิธีที่ 1 : ใช้เครื่องหมาย &
  1. เลือกเซลล์ที่ต้องการ
  2. พิมพ์คำสั่ง =เซลล์1 & เซลล์2 & เซลล์3 & ...
    เช่น    =A1 & A2 & A3
             ="Text : " & A1 & A2
วิธีที่ 2 : ใช้ฟังก์ชัน Concatenate
  1. เลือกเซลล์ที่ต้องการ
  2. พิมพ์คำสั่ง =Concatenate(เซลล์1, เซลล์2, เซลล์3, ...)
    เช่น    =Concatenate(A1, A2, A3)
             =Concatenate("Text : ", A1, A2)

* ทั้งสองวิธีได้ผลลัพธ์เหมือนกัน

ตั้งค่าเมาส์ให้ใช้ใน vmware โดยเฉพาะ

สิ่งที่ต้องเตรียม
  • เมาส์ USB 1 ตัว
วิธีทำ 
  1. แก้ไขไฟล์ .vmx โดยเพิ่มคำสั่ง ดังนี้
    usb.generic.allowHID = "TRUE"
    usb.generic.allowLastHID = "TRUE"
  2. เลือก virtual machine ที่ต้องการ แล้วเลือก Edit virtual machine settings
  3. ที่หน้าต่าง Hardware เลือก Add
  4. เลือก USB Controller แล้วกด Next
  5. เลือก USB รุ่นที่ต้องการ แล้วกด Finish

วันศุกร์ที่ 2 กันยายน พ.ศ. 2559

แก้ปัญหา flash drive มีข้อมูลแต่มองไม่เห็น

  1. เปิดหน้าต่าง command โดยไปที่ Start -> Run แล้วพิมพ์ cmd แล้วกด Enter
  2. พิมพ์ drive letter ที่ flash drive เราเชื่อมต่ออยู่ตามด้วยเครื่องหมาย : เช่น F:
  3. แล้วพิมพ์คำสั่ง attrib *.* -s -h -a -r /d /s ลงไป
  4. เปิด flash drive ดู ก็จะเห็นไฟล์ที่ซ่อนอยู่

แก้ปัญหา visual studio ฟ้อง "package did not load correctly"

  1. ปิดโปรแกรม visual studio ก่อน
  2. ลบทุกอย่างในโฟลเดอร์ C:\Users\%username%\AppData\Local\Microsoft\VisualStudio\14.0\ComponentModelCache
  3. เปิดโปรแกรมใหม่

วันพุธที่ 24 สิงหาคม พ.ศ. 2559

Excel : แปลงจำนวนเงินจากตัวเลขเป็นตัวหนังสือภาษาอังกฤษ

  1. เปิดไฟล์ Excel
  2. กด ALT+F11 เพื่อเปิด Visual Basic Editor
  3. ไปที่ Insert -> Module
  4. คัดลอก code นี้ไปวาง
  5. Option Explicit
    'Main Function
    Function SpellNumber(ByVal MyNumber)
        Dim Dollars, Cents, Temp
        Dim DecimalPlace, Count
        ReDim Place(9) As String
        Place(2) = " Thousand "
        Place(3) = " Million "
        Place(4) = " Billion "
        Place(5) = " Trillion "
        ' String representation of amount.
        MyNumber = Trim(Str(MyNumber))
        ' Position of decimal place 0 if none.
        DecimalPlace = InStr(MyNumber, ".")
        ' Convert cents and set MyNumber to dollar amount.
        If DecimalPlace > 0 Then
            Cents = GetTens(Left(Mid(MyNumber, DecimalPlace + 1) & _
                      "00", 2))
            MyNumber = Trim(Left(MyNumber, DecimalPlace - 1))
        End If
        Count = 1
        Do While MyNumber <> ""
            Temp = GetHundreds(Right(MyNumber, 3))
            If Temp <> "" Then Dollars = Temp & Place(Count) & Dollars
            If Len(MyNumber) > 3 Then
                MyNumber = Left(MyNumber, Len(MyNumber) - 3)
            Else
                MyNumber = ""
            End If
            Count = Count + 1
        Loop
        Select Case Dollars
            Case ""
                Dollars = "No Baht"
            Case "One"
                Dollars = "One Baht"
             Case Else
                Dollars = Dollars & " Baht"
        End Select
        Select Case Cents
            Case ""
                Cents = " and No Satang"
            Case "One"
                Cents = " and One Satang"
                  Case Else
                Cents = " and " & Cents & " Satang"
        End Select
        SpellNumber = Dollars & Cents
    End Function
         
    ' Converts a number from 100-999 into text
    Function GetHundreds(ByVal MyNumber)
        Dim Result As String
        If Val(MyNumber) = 0 Then Exit Function
        MyNumber = Right("000" & MyNumber, 3)
        ' Convert the hundreds place.
        If Mid(MyNumber, 1, 1) <> "0" Then
            Result = GetDigit(Mid(MyNumber, 1, 1)) & " Hundred "
        End If
        ' Convert the tens and ones place.
        If Mid(MyNumber, 2, 1) <> "0" Then
            Result = Result & GetTens(Mid(MyNumber, 2))
        Else
            Result = Result & GetDigit(Mid(MyNumber, 3))
        End If
        GetHundreds = Result
    End Function
         
    ' Converts a number from 10 to 99 into text.
    Function GetTens(TensText)
        Dim Result As String
        Result = ""           ' Null out the temporary function value.
        If Val(Left(TensText, 1)) = 1 Then   ' If value between 10-19...
            Select Case Val(TensText)
                Case 10: Result = "Ten"
                Case 11: Result = "Eleven"
                Case 12: Result = "Twelve"
                Case 13: Result = "Thirteen"
                Case 14: Result = "Fourteen"
                Case 15: Result = "Fifteen"
                Case 16: Result = "Sixteen"
                Case 17: Result = "Seventeen"
                Case 18: Result = "Eighteen"
                Case 19: Result = "Nineteen"
                Case Else
            End Select
        Else                                 ' If value between 20-99...
            Select Case Val(Left(TensText, 1))
                Case 2: Result = "Twenty "
                Case 3: Result = "Thirty "
                Case 4: Result = "Forty "
                Case 5: Result = "Fifty "
                Case 6: Result = "Sixty "
                Case 7: Result = "Seventy "
                Case 8: Result = "Eighty "
                Case 9: Result = "Ninety "
                Case Else
            End Select
            Result = Result & GetDigit _
                (Right(TensText, 1))  ' Retrieve ones place.
        End If
        GetTens = Result
    End Function
        
    ' Converts a number from 1 to 9 into text.
    Function GetDigit(Digit)
        Select Case Val(Digit)
            Case 1: GetDigit = "One"
            Case 2: GetDigit = "Two"
            Case 3: GetDigit = "Three"
            Case 4: GetDigit = "Four"
            Case 5: GetDigit = "Five"
            Case 6: GetDigit = "Six"
            Case 7: GetDigit = "Seven"
            Case 8: GetDigit = "Eight"
            Case 9: GetDigit = "Nine"
            Case Else: GetDigit = ""
        End Select
    End Function
  6.  กด บันทึก แล้ว ปิดหน้าต่าง Visual Basic Editor
 การใช้งาน
  • พิมพ์ =SpellNumber(ตัวเลข) เช่น =SpellNumber(32.50) จะได้ว่า "Thirty Two Bath and Fifty Satang" 

ที่มา https://support.microsoft.com/en-us/kb/213360

วันเสาร์ที่ 16 กรกฎาคม พ.ศ. 2559

เพิ่ม PSU mail ใน app Gmail บนมือถือ

  1. เปิด app Gmail ในมือถือ
  2. เลือก เมนู [1] แล้วไปที่ setting [2]



  3. เลือก Add account


  4. เลือกหัวข้อ Personal (IMAP/POP) แล้วกด NEXT


  5. พิมพ์ E-mail ของ PSU แล้วกด NEXT


  6. เลือกหัวข้อ Personal (POP3) แล้วกด NEXT


  7. ในช่อง Username ให้ลบ "@psu.ac.th" ออก ส่วนในช่อง Server ให้เปลี่ยนเป็น "mail.psu.ac.th" แล้วกด NEXT


  8. ในช่อง SMTP server ให้เปลี่ยนเป็น "smtp2.psu.ac.th" แล้วกด NEXT

  9. ตั้งค่าการ sync ข้อมูล

  10. เสร็จเรียบร้อย

วันศุกร์ที่ 8 กรกฎาคม พ.ศ. 2559

Windows10 taskbar not working

อาการที่พบ
  • คลิกซ้ายที่ปุ่ม Start หรือ icon ทางขวาของ taskbar แล้วไม่มีอะไรขึ้นมา

วิธีแก้ไข
  • กดปุ่ม Win + R หรือ คลิกขวาที่ปุ่ม Start -> Run จะพบหน้าต่างแบบนี้


  • พิมพ์ regedit.exe แล้วกด Enter


  • ไปยังที่อยู่นี้
    “HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced”
  • หา Registry ชื่อ EnableXAMLStartMenu


    • ถ้ามีอยุ่แล้วให้คลิกขวาที่ "EnableXAMLStartMenu" แล้วเลือก modify.. จากนั้นให้แก้ค่าเป็น 0
    • ถ้าไม่มีให้คลิกขวาในที่ว่างแล้วเลือก New -> DWORD (32-bit) value จากนั้นให้ตั้งชื่อว่า "EnableXAMLStartMenu" เมื่อเรียบร้อยแล้วให้ Restart คอมพิวเตอร์ใหม่อีกครั้ง

Memory leak in Windows 10 with Killer E2200

อาการที่พบ

  • เมื่อใช้งานไปนานๆ จะรู้สึกว่าเครื่องช้า เพราะ Ram ของระบบเต็ม


วิธีแก้ไข
  • พิมพ์ regedit.exe ทีช่องค้นหา เพื่อเปิดหน้าต่างแก้ไข registry
  • ไปที่ HKEY_LOCAL_MACHINE\SYSTEM\ControlSet001\Services\Ndu\
  • แก้ไข registry ชื่อ "start" โดยกำหนดค่าให้เท่ากับ 4
  • Restart

CentOS : เพิ่มผู้ใช้ไปยังกลุ่ม

  • เพิ่มกลุ่มใหม่
    groupadd groupname

  • เพิ่มผู้ใช้ไปยังกลุ่ม
    usermod -a -G groupname username

  • เพิ่มผู้ใช้ไปยังหลายกลุ่ม
    usermod -a -G groupname1,groupname2,... username

  • เปลี่ยนกลุ่มหลักของผู้ใช้
    usermod -g groupname username

  • ต้องการดูว่าผู้ใช้นี้อยู่ในกลุ่มไหนบ้าง
    id username   หรือ   groups username