Posts

Showing posts with the label excel vba

Data Entry Form Connected With Database (Excel Sheet)

Image
VBA Code - Option Explicit Dim curRecNo As Long Private Sub btnFirst_Click()          If Me.cmbEmpName.ListCount > 0 Then              Me.cmbEmpName.ListIndex = 0                  curRecNo = Me.cmbEmpName.ListIndex + 1         Me.lblCurrentRecNo.Caption = "Record No.: " & curRecNo              End If      End Sub Private Sub btnLast_Click()     If Me.cmbEmpName.ListCount > 0 Then              Me.cmbEmpName.ListIndex = Me.cmbEmpName.ListCount - 1                  curRecNo = Me.cmbEmpName.ListCount         Me.lblCurrentRecNo.Caption = "Record No.: " & curRecNo              End If          End Sub Private Sub btnNext_Click()   ...

Excel VBA To Insert Multiple Images From A Folder To Worksheet

Image
  VBA Code - Option Explicit Private Sub btnInsertPictures_Click()     Dim photo As Shape     Dim ImgNameCol As Integer, ImgCol As Integer     Dim CCol As Integer, TCol As Integer     Dim CRow As Integer, TRow As Integer     Dim Ws As Worksheet     Dim imgno As Integer     imgno = 1     Set Ws = ActiveWorkbook.Sheets(Me.cmbSheets.Text)     '************ delete all images **************     Dim Shp As Shape     For Each Shp In Ws.Shapes         If VBA.Left(Shp.Name, 8) = "EmpImage" Then             Shp.Delete         End If     Next Shp     '*********************************************     CRow = Me.txtHeadingRow.Text     TCol = Ws.Cells(CRow, Columns.Count).End(xlToLeft).Column     For CCol = 1 To TCol   ...