Page 1 of 1

การ insert รูปจาก userfrom ไปใส่ใน cell ต้องเขียน vba อย่างไรครับ

Posted: Tue Oct 22, 2019 3:12 pm
by tejasiddh

Code: Select all

Private Sub CommandButton1_Click()
emptyRow = WorksheetFunction.CountA(Range("B:B")) + 1
Cells(emptyRow, 2).Value = TextBox1.Value
Cells(emptyRow, 3).Value = TextBox2.Value
Cells(emptyRow, 4).Value = TextBox3.Value
Cells(emptyRow, 5).Value = TextBox4.Value
Cells(emptyRow, 7).Value = TextBox5.Value
Cells(emptyRow, 6).Value = DTPicker1.Value
Cells(emptyRow, 8).Value = Image1.Picture
End Sub

Re: การ insert รูปจาก userfrom ไปใส่ใน cell ต้องเขียน vba อย่างไรครับ

Posted: Tue Oct 22, 2019 7:49 pm
by snasui
:D สร้างตัวแปรเก็บค่า Path ของรูปที่ Load เข้า User Form แล้วค่อย Load มาวางใน Excel ครับ

ตัวอย่าง Code การวางภาพใน Excel ดูได้ที่ Link นี้ครับ https://snasui.com/viewtopic.php?f=3&t=16251#p96946