Option Explicit was not in module of file I downloaded. That's why I mentioned it. I added it and found a variable that had not been declared.
I still don't know what you mean by "full size". Looks big enough to me. If you want to view in an external image app, managing that would be more difficult.
Need to add code that disables/enables Prev/Next buttons when on first or last file.
Also make sure Filelist is cleared before reading in file names from selected folder.
Consider this revised code:
Option Explicit Dim v_row As Integer Dim v_filecount As Integer Sub LoadNextImage() If v_row < v_filecount Then LoadImage 1 Else MsgBox "This is last image" End If End Sub Sub LoadPrevImage() If v_row > 3 Then LoadImage -1 Else MsgBox "This is first image" End If End Sub Sub LoadImage(intDirection) Sheets("Update").Range("K9").Value = Sheets("Update").Range("K9").Value + intDirection v_row = Sheets("Update").Range("K9").Value Sheets("Update").Image1.Picture = LoadPicture(Sheets("Filelist").Range("B1").Value & Sheets("Filelist").Range("B" & v_row).Value) Sheets("Update").Range("K7").Value = Sheets("Filelist").Range("B" & v_row).Value End Sub Function GetImageDirectory() As String Dim v_imagefolder As FileDialog Dim v_imageitem As String Set v_imagefolder = Application.FileDialog(msoFileDialogFolderPicker) With v_imagefolder .Title = "Select the Image Folder" .AllowMultiSelect = False .InitialFileName = Application.DefaultFilePath If .Show <> -1 Then GoTo NextCode v_imageitem = .SelectedItems(1) End With NextCode: If Right(v_imageitem, 1) <> "\" Then v_imageitem = v_imageitem & "\" End If GetImageDirectory = v_imageitem Set v_imagefolder = Nothing End Function Sub ListImageFiles() Dim v_fldrpath As String, v_pth As String, Filename As String v_fldrpath = GetImageDirectory Sheets("Filelist").Range("B1").Value = v_fldrpath v_pth = v_fldrpath Filename = Dir(v_pth) Sheets("Filelist").Range("A3:B" & Sheets("Filelist").Cells.SpecialCells(xlCellTypeLastCell).Row).Clear Do While Filename <> "" v_filecount = v_filecount + 1 Sheets("Filelist").Range("A" & v_filecount + 2).Value = v_filecount Sheets("Filelist").Range("B" & v_filecount + 2).Value = Filename Filename = Dir() Loop Sheets("Update").Range("K9").Value = 3 LoadImage 0 End Sub Sub ChangeName() Dim oldname As String, newname As String oldname = Sheets("Filelist").Range("B1").Value & Sheets("Update").Range("K7").Value newname = Sheets("Filelist").Range("B1").Value & Sheets("Update").Range("K11").Value Name oldname As newname v_row = Sheets("Update").Range("K9").Value Sheets("Filelist").Range("B" & v_row).Value = Sheets("Update").Range("K11").Value LoadImage 0 End Sub




Reply With Quote