first are you doing this in access or excel, because you mentioned both software.
Hi there and welcome
Sorry about the confusion, it is very clear what your asking.
If you already have the picture in the file, then you will want to use this code to center it
Dim myR As RangeSet myR = Application.InputBox( _ "Center the selected picture on what cell?", , , , , , , 8)Selection.ShapeRange.Top = myR.TopSelection.ShapeRange.Left = myR.Left
Selection.ShapeRange.IncrementLeft (myR.Width - Selection.ShapeRange.Width) / 2
If you have not yet actually added the picture to the file, then this code will allow you to both select the picture and insert it in a centered manner
Dim myR As RangeSet myR = Selection'Insert the pictureActiveSheet.Pictures.Insert( _ Application.GetOpenFilename( _ "JPG picture files (*.jpg),*.jpg", , "Select the picture")).Select 'center the picture on the current range selectionSelection.ShapeRange.IncrementLeft (myR.Width - Selection.ShapeRange.Width) / 2
I can also do this code for you directly in your sheet, and have made the offer, please accept it and I can then do this for you