Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations JAE on being selected by the Eng-Tips community for having the most helpful posts in the forums last week. Way to Go!

Hi Everyone, I am kind of beginn 1

Status
Not open for further replies.

Dwaipayan Sharma

Civil/Environmental
Joined
Feb 10, 2021
Messages
7
Location
US
Hi Everyone,

I am kind of beginner on VBA and I have created the program in VBA to create the photo sheet. I am having some issue with creating the exact border I was looking for.
Right now, I have created the single line border with the weight of 2. But what I am looking for is Haze border with grey color.
Could you please help me updating the border lines in the Module?

Module I am using right now:

PhotoShape.Line.Style = msoLineSingle
PhotoShape.Line.Weight = 2

Attached are the two photos: First photo is the border with existing module in VBA and second one is the border I am looking for.

Border_I_have_bjfinl.jpg
Border_I_am_looking_for_es6gal.jpg


Thanks!
 
I haven't done much with formatting images from VBA recently, but doing a quick trial with the macro recorder produced the following code:

Code:
Sub SelectBorder()
'
' SelectBorder Macro
'
    ActiveSheet.Shapes.Range(Array("Picture 1")).Select
    With Selection.ShapeRange.Line
        .Visible = msoTrue
        .Weight = 5.25
    End With
    With Selection.ShapeRange.Line
        .Visible = msoTrue
        .ForeColor.ObjectThemeColor = msoThemeColorBackground1
        .ForeColor.TintAndShade = 0
        .ForeColor.Brightness = -0.150000006
        .Transparency = 0
    End With
End Sub

To get that I pasted an image then clicked a blank cell, turned on the macro recorder (Developer Tab), selected the image again, right click and select Format Picture, then set the width to 5.25 and the colour to light grey, then click stop recording.
Does that give you sufficient to do what you want?


Doug Jenkins
Interactive Design Services
 
If you are not sure, record a macro doing just the thing you are looking for, then look at the macro to see one way to do it. Usually you can simplify the auto-recorded macro to something simpler.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top