Browse picture and enlarge it

eliozo

Board Regular
Joined
Oct 22, 2010
Messages
80
I need to create a button where i can browse a picture and put it in cell E5 for example (technically it should be small). When i click on it, it should become bigger and when i click on it again it should take place again in cell E5. Please help..

Plus if I need to create another button where i want to print this picture but in a bigger scale, how should i do it ? Thank you so much !!
 
Here is the basic code
VBA Code:
Sub Print5()
    Dim rng As String
    On Error Resume Next
    rng = Application.InputBox("select a cell", "Print 5 cells", , , , , , 8).Cells(1, 1).Resize(, 5).Address(0, 0)
    On Error GoTo TheEnd
    If MsgBox("Print " & rng & " ?", vbYesNo, "") = vbYes Then
        With ActiveSheet
            .PageSetup.PrintArea = rng
            .PrintOut
        End With
    End If
TheEnd:
End Sub

You will probably need to amend it to print the way you want - that is down to you now

Here are 2 pages to help you

Don't forget that you can record a macro when doing things manually
- when recording printing changes, the recorder usually records lots of lines
- pick out the necessary lines of code that you require
 
Upvote 0

Excel Facts

Is there a shortcut key for strikethrough?
Ctrl+S is used for Save. Ctrl+5 is used for Strikethrough. Why Ctrl+5? When you use hashmarks to count |||| is 4, strike through to mean 5.
Amazing !!! Thank you so much !!
One last favor if possible:

i need a button where it will ask me to specify a cell as previously done and send an email with the below content and the cell selected should be the [CELL SELECTED] in the code and the one beside should be [BESIDE CELL SELECTED] and the one beside .... ect
Plz help !

Private Sub CommandButton196_Click()

Dim objOutlook As Object

Dim objNameSpace As Object

Dim objOlAccount As Object

Dim objMailItem As Object

Dim Recip As String

Dim Send As String

Dim rng As Range



On Error Resume Next

Set objOutlook = GetObject(, "Outlook.Application")

On Error GoTo 0



If objOutlook Is Nothing Then

Set objOutlook = CreateObject("Outlook.Application")

Set objNameSpace = objOutlook.GetNamespace("MAPI")

End If



Recip = "URGENT REMINDER! " & "Request # " & [SELECTED CELL].Value & " " & "Unit: " & [BESIDE SELECTED CELL].Value & " " & "Description: " & [BESIDE BESIDE SELECTED CELL].Value & " " & "Request Date: " & [BESIDE BESIDE BESIDE SELECTED CELL].Value & " Thank You!"

Send = [AW30].Value

SendCC = [AW31].Value



Set objMailItem = objOutlook.createitem(0)



With objMailItem

.To = Send

.CC = SendCC

.BCC = ""

.Subject = "Urgent Maintenance Request"

.Body = Recip



.display

End With



Set objMailItem = Nothing

Set objOlAccount = Nothing

Set objNameSpace = Nothing

Set objOutlook = Nothing

End Sub
 
Upvote 0
Did you forget to place code tags around your code?
Post#12 is nothing to do with the original question - please start a new thread and include your code in code tags to make it easier for anyone trying to help you
thanks
 
Upvote 0

Forum statistics

Threads
1,214,834
Messages
6,121,876
Members
449,056
Latest member
ruhulaminappu

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top