Inserting image to Cell from User Form

hdevadiga

New Member
Joined
Dec 15, 2007
Messages
4
Dear User,

I have a query regarding this.. Myself Created a form which have a option to add image. whtever Data entry u do i get save to sheet1..

I want this when a user do data entry he can add image and save to the particular column in Excel Sheet... Everytime when user make a fresh entry that image get save in to excel sheet with the data format which is mentioned below

Column A - Dist Name
Column B - Office Address
.
.
.
.
.
Column T - Image

The Code is like this:


Private Sub cmdsub_Click()
Dim iRow As String
Dim ws As Worksheet

Set ws = Worksheets("GI")

iRow = ws.Cells(Rows.Count, 1).End(xlUp).Offset(1, 0).Row
ws.Cells(iRow, 1).Value = Me.txtdisn.Value
ws.Cells(iRow, 2).Value = Me.txtcont.Value
ws.Cells(iRow, 3).Value = Me.txtoffadd.Value
ws.Cells(iRow, 4).Value = Me.txtofftel.Value
ws.Cells(iRow, 5).Value = Me.txtmobile.Value
ws.Cells(iRow, 6).Value = Me.txtresadd.Value
ws.Cells(iRow, 7).Value = Me.txtrestel.Value
ws.Cells(iRow, 8).Value = Me.txtemail.Value
ws.Cells(iRow, 9).Value = Me.txtdisdob.Value
ws.Cells(iRow, 10).Value = Me.txtwifen.Value
ws.Cells(iRow, 11).Value = Me.txtwifedob.Value
ws.Cells(iRow, 12).Value = Me.txtwa.Value
ws.Cells(iRow, 13).Value = Me.txtnok.Value
ws.Cells(iRow, 14).Value = Me.txtc1n.Value
ws.Cells(iRow, 15).Value = Me.txtc1dob.Value
ws.Cells(iRow, 16).Value = Me.txtc2n.Value
ws.Cells(iRow, 17).Value = Me.txtc2dob.Value
ws.Cells(iRow, 18).Value = Me.txtc3n.Value
ws.Cells(iRow, 19).Value = Me.txtc3dob.Value
ws.Cells(iRow, 20).Value = Me.Image1.Picture
With Me
.txtdisn.Value = ""
.txtcont.Value = ""
.txtoffadd.Value = ""
.txtofftel.Value = ""
.txtmobile.Value = ""
.txtresadd.Value = ""
.txtrestel.Value = ""
.txtemail.Value = ""
.txtdisdob.Value = ""
.txtwifen.Value = ""
.txtwifedob.Value = ""
.txtwa.Value = ""
.txtnok.Value = ""
.txtc1n.Value = ""
.txtc1dob.Value = ""
.txtc2n.Value = ""
.txtc2dob.Value = ""
.txtc3n.Value = ""
.txtc3dob.Value = ""
.Image1.Object
End With
End Sub
 

Excel Facts

Return population for a City
If you have a list of cities in A2:A100, use Data, Geography. Then =A2.Population and copy down.

Forum statistics

Threads
1,215,432
Messages
6,124,860
Members
449,194
Latest member
HellScout

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top