Programming

Programming Questions? Ask a Programmer for Answers ASAP

Ask a Computer Expert,
Get an Answer ASAP!

Programming

I'm not versed in VBA so I need a lot of help. I want to set up a macro in Excel 2016 to do a simple task such as...

Customer Question
okay, I'm not versed in...
okay, I'm not versed in VBA so I need a lot of help. I want to set up a macro in Excel 2016 to do a simple task such as centering an object within a specific cell or a range of cells. I've already been told that access is the best software to do that but I opened access and it all looks Greek to me. I've been using Word, Publisher, & Excel for several years with moderate success. I don't do this for a living I just run my church's monthly newsletter and I'm trying to create a directory of peoples names and photos where the photo is centered in each cell above the name, address, etc. I copied as code from the internet that is supposed to center an object but I can't seem to get a grip on the step by step needed to set up a macro to use this code. Help?
Submitted: 1 year ago.Category: Programming
Show More
Show Less
Ask Your Own Programming Question
Answered in 1 minute by:
6/6/2016
Programmer: The-PC-Guy, Software Engineer replied 1 year ago
The-PC-Guy
The-PC-Guy, Software Engineer
Category: Programming
Satisfied Customers: 2,087
Experience: Extensive Knowledge in PHP, MYSQL, CSS & Javascript
Verified

first are you doing this in access or excel, because you mentioned both software.

Ask Your Own Programming Question
Programmer: Richard, Consultant replied 1 year ago
Richard
Richard, Consultant
Category: Programming
Satisfied Customers: 41,126
Experience: Programming and Network consultancy for 15+ years
Verified

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

Sub CenterSelectedPicture()

Dim myR As Range
Set myR = Application.InputBox( _
"Center the selected picture on what cell?", , , , , , , 8)
Selection.ShapeRange.Top = myR.Top
Selection.ShapeRange.Left = myR.Left

Selection.ShapeRange.IncrementLeft (myR.Width - Selection.ShapeRange.Width) / 2

End Sub

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

Sub InsertCenterPicture()

Dim myR As Range
Set myR = Selection
'Insert the picture
ActiveSheet.Pictures.Insert( _
Application.GetOpenFilename( _
"JPG picture files (*.jpg),*.jpg", , "Select the picture")).Select
'center the picture on the current range selection
Selection.ShapeRange.IncrementLeft (myR.Width - Selection.ShapeRange.Width) / 2

End Sub

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

thank you

Ask Your Own Programming Question
Ask Richard Your Own Question
Richard
Richard
Richard, Consultant
Category: Programming
Satisfied Customers: 41,126
41,126 Satisfied Customers
Experience: Programming and Network consultancy for 15+ years

Richard is online now

A new question is answered every 9 seconds

How JustAnswer works:

  • Ask an ExpertExperts are full of valuable knowledge and are ready to help with any question. Credentials confirmed by a Fortune 500 verification firm.
  • Get a Professional AnswerVia email, text message, or notification as you wait on our site. Ask follow up questions if you need to.
  • 100% Satisfaction GuaranteeRate the answer you receive.

JustAnswer in the News:

Ask-a-doc Web sites: If you've got a quick question, you can try to get an answer from sites that say they have various specialists on hand to give quick answers... Justanswer.com.
JustAnswer.com...has seen a spike since October in legal questions from readers about layoffs, unemployment and severance.
Web sites like justanswer.com/legal
...leave nothing to chance.
Traffic on JustAnswer rose 14 percent...and had nearly 400,000 page views in 30 days...inquiries related to stress, high blood pressure, drinking and heart pain jumped 33 percent.
Tory Johnson, GMA Workplace Contributor, discusses work-from-home jobs, such as JustAnswer in which verified Experts answer people’s questions.
I will tell you that...the things you have to go through to be an Expert are quite rigorous.

What Customers are Saying:

My Expert answered my question promptly and he resolved the issue totally. This is a great service. I am so glad I found it I will definitely use the service again if needed.

One Happy CustomerNew York

Wonderful service, prompt, efficient, and accurate. Couldn't have asked for more. I cannot thank you enough for your help.

Mary C.Freshfield, Liverpool, UK

This expert is wonderful. They truly know what they are talking about, and they actually care about you. They really helped put my nerves at ease. Thank you so much!!!!

AlexLos Angeles, CA

Thank you for all your help. It is nice to know that this service is here for people like myself, who need answers fast and are not sure who to consult.

GPHesperia, CA

I couldn't be more satisfied! This is the site I will always come to when I need a second opinion.

JustinKernersville, NC

Just let me say that this encounter has been entirely professional and most helpful. I liked that I could ask additional questions and get answered in a very short turn around.

EstherWoodstock, NY

Thank you so much for taking your time and knowledge to support my concerns. Not only did you answer my questions, you even took it a step further with replying with more pertinent information I needed to know.

RobinElkton, Maryland

< Previous | Next >

Meet the Experts:

ATLPROG

ATLPROG

Computer Software Engineer

7,677 satisfied customers

MS in IT.Several years of programming experience in Java C++ C C# Python VB Javascript HTML

LogicPro

LogicPro

Computer Software Engineer

7,131 satisfied customers

Expert in C, C++, Java, DOT NET, Python, HTML, Javascript, Design.

unvadim

unvadim

Computer Software Engineer

1,168 satisfied customers

Good knowledge of OOP principles. 3+ years of programming experience with Java and C++. Sun Certified Java Programmer 5.0.

lifesaver

lifesaver

Computer Software Engineer

950 satisfied customers

Several years of intensive programming and application development experience in various platforms.

ehabtutor

ehabtutor

Computer Software Engineer

936 satisfied customers

Bachelor of computer science, 5+ years experience in software development, software company owner

TheDoctor

TheDoctor

Software Engineer

893 satisfied customers

M.S. in Internet Information Systems

The-PC-Guy

The-PC-Guy

Software Engineer

2,087 satisfied customers

Extensive Knowledge in PHP, MYSQL, CSS & Javascript

< Previous | Next >

Related Programming Questions
I need help with conditional formatting on an excel
I need help with conditional formatting on an excel spreadsheet. I have a main page in the excel book that I enter values in and further down the table, if the values are greater than one number and l… read more
Richard
Richard
Consultant
41,126 satisfied customers
I have had a mailing list in excel (personal) for years. Can
I have had a mailing list in excel (personal) for years. Can you help me find it so I can update it?? … read more
Sheri
Sheri
Bachelor\u0027s Degree
105 satisfied customers
Not sure how to explain this...but I have an excel report
Hi! Not sure how to explain this...but I have an excel report with a field name for first name and one for last name. The report contains multiple people from the same household, one row for each. Eac… read more
The-PC-Guy
The-PC-Guy
Software Engineer
2,087 satisfied customers
My excel files are locked for editing I am the only user.
my excel files are locked for editing I am the only user … read more
Kamil Anwar
Kamil Anwar
IT Consultant / Systems Engineer
Bachelor\u0027s Degree
434 satisfied customers
Not able to use Word and Excel. Have not since Windows 10
Have not since Windows 10 was installed in Jan. 2016 … read more
Jason Jones
Jason Jones
AAS Information Technology
6,320 satisfied customers
I have already written some of my calculations in excel, but
I have already written some of my calculations in excel, but i need additional calculations to be added to the existing ones. . . … read more
The-PC-Guy
The-PC-Guy
Software Engineer
2,087 satisfied customers
I can not use microsoft Excel or Word. Can not fix the
I can not use microsoft Excel or Word. Can not fix the problem … read more
ChrisC
ChrisC
PC Technician
Associate Degree
660 satisfied customers
I was looking for an excel formula to find dollar amount
Hello,I was looking for an excel formula to find dollar amount change between two values and then to find the %change on these two values … read more
Richard
Richard
Consultant
41,126 satisfied customers
I use an Excel spreadsheet as a continuous log of notes,
I use an Excel spreadsheet as a continuous log of notes, calculations etc. … read more
Cabletech
Cabletech
High School or GED
140 satisfied customers
I need some help with my excel query, I have an excel
I have an excel workbook with several sheets. One sheet (ClientTbl) is set up as the parent table and all other sheets (each on separate tab) are set up as the child tables, i.e AddressTbl, EmployTbl, etc... The reason for this is that due to the nature of our contact with clients, it is likely that their address will change from one contact to the next or they will change employer from one contact to the next. Within the child tables, the date and time the information is entered is automatically record. I need to create a query to create one CURRENT record for each client and would like to take advantage of the pre-record date/time filed to ONLY report the record from each table that is the most recent. How would I go about doing this? I have put sample tables below ClientTblID LastName FirstName 1 Doe JohnAddressTblID Address Date 1 15 N. Somewhere Ave 11/1/2017 1*****11/27/2017EmployTblID Employer Date 1 Brown Company 10/20/2017 1 Orange Group 11/21/2017Desired Query Results:ID LastName FirstName Address Date Employer Date 1 Doe John*****11/27/2017 Orange Group 11/21/2017Any help you can provide would be appreciated! Thank you!!! … read more
The-PC-Guy
The-PC-Guy
Software Engineer
2,087 satisfied customers
Can not log in to excel or word---: Microsoft stopped
can not log in to excel or word---: Microsoft stopped working" … read more
Isaac Franklin
Isaac Franklin
Associate of Science in Social Sciences
976 satisfied customers
How do I write this formula correctly in excel? Excel 2010
Hello Pearl How do I write this formula correctly in excel? … read more
The-PC-Guy
The-PC-Guy
Software Engineer
2,087 satisfied customers
I need Excel help that is advanced in nature... In Excel, I
Hello, I need Excel help that is advanced in nature... … read more
The-PC-Guy
The-PC-Guy
Software Engineer
2,087 satisfied customers
I have an Excel question how does this work? Excel 2010. I
I need a formula but it would be easier to show you what I need rather than trying to explain it is there a way I can do that? … read more
Richard
Richard
Consultant
41,126 satisfied customers
Changed formatting resets every time excel is opened. Excel
changed formatting resets every time excel is opened … read more
R LAFAYETTE
R LAFAYETTE
Intel Technology Provider 2017 GOLD
37 satisfied customers
I just have one question on excel. Excel 2016. I need some
HI I just have one question on excel JA: What programs and versions are you using? Customer: excel 2016 JA: What is your ideal outcome? How can we solve this for you? Customer: I need some tip tips st… read more
David L.
David L.
Bachelor\u0027s Degree
6 satisfied customers
I need some help with an excel formula. Microsoft excel
I trying to use an index and match function using three criteria to pull a value off of a chart … read more
The-PC-Guy
The-PC-Guy
Software Engineer
2,087 satisfied customers
I need help with excel function. Excel 2013. I have a math
i have a math problem and i have been posting in many sites … read more
John Lohr
John Lohr
Owner / Technology Specialist
Teaching Certification
511 satisfied customers
Disclaimer: Information in questions, answers, and other posts on this site ("Posts") comes from individual users, not JustAnswer; JustAnswer is not responsible for Posts. Posts are for general information, are not intended to substitute for informed professional advice (medical, legal, veterinary, financial, etc.), or to establish a professional-client relationship. The site and services are provided "as is" with no warranty or representations by JustAnswer regarding the qualifications of Experts. To see what credentials have been verified by a third-party service, please click on the "Verified" symbol in some Experts' profiles. JustAnswer is not intended or designed for EMERGENCY questions which should be directed immediately by telephone or in-person to qualified professionals.

Disclaimer: Information in questions, answers, and other posts on this site ("Posts") comes from individual users, not JustAnswer; JustAnswer is not responsible for Posts. Posts are for general information, are not intended to substitute for informed professional advice (medical, legal, veterinary, financial, etc.), or to establish a professional-client relationship. The site and services are provided "as is" with no warranty or representations by JustAnswer regarding the qualifications of Experts. To see what credentials have been verified by a third-party service, please click on the "Verified" symbol in some Experts' profiles. JustAnswer is not intended or designed for EMERGENCY questions which should be directed immediately by telephone or in-person to qualified professionals.

Show MoreShow Less

Ask Your Question

x