Relative Content

Tag Archive for excelvba6

Microsoft Excel 365 VBA – Inserting Image into Table via UserForm

Private Sub CommandButton1_Click() With Application.FileDialog(msoFileDialogFilePicker) .AllowMultiSelect = False .ButtonName = “Submit” .Title = “Select an image file” .Filters.Add “Image”, “*.gif; *.jpg; *.jpeg”, 1 If .Show = -1 Then ‘ file has been selected ‘ e.g. show path in textbox ‘ Me.Label9.Text = .SelectedItems(1) ‘ e.g. display preview image in an image control Me.Image1.PictureSizeMode = fmPictureSizeModeZoom […]

UserForm_Initialize not processing as expecteded, etc

Apologies I’ve I’ve not posted this correctly. I don’t know how to put my vba coding into its own window.
I’ve been relearning to use excel and vba try to automate an excel monthly meal plan for a seniors’ home in which I live. After several months, I’ve accomplished a lot. That said, I’ve been exploring how I might optimize my coding, reduce redundant variable, and restructure the file by expanding the versatility of some subs. To that end, I’ve integrated Debug.Print to help. What an eye-opener!!!!
Just within my first few subs I saw things happening I needed to understand to better design my subs and functions. In truth, I have yet to apply functions, but their structure seems to be more complicated for my aging brain. Two important things at this point I hope can be explained as they could vastly improve the entire structure of my file. I’ve embedded comments in my coding to try to limit the length of my question and provide context