Twitter iPhone pliant OnePlus 11 PS5 Disney+ Orange Livebox Windows 11

shape sans cadre

5 réponses
Avatar
Guy72
Bonjour,
J'ai le code suivant qui me donne un emplacement de texte suivant le clic
dans la cellule.
Mais ce code me fait un cadre.
Je souhaiterais ne pas avoir de cadre.
J'ai beau essayer, mais je n'y arrive pas.
Pouvez vous me dire ce qu'il faut modifier ?
Merci de votre aide.

Sub Heures()
hcel = ActiveCell.Height / 2
Lcel = ActiveCell.Width * 2
PosHt = ActiveCell.Top
posLHt = ActiveCell.Left

Set myDocument = Worksheets(1)
myDocument.Shapes.AddTextbox(msoTextOrientationHorizontal, posLHt, PosHt,
Lcel, hcel).Select
x = myDocument.Shapes.Count + 1
With Selection
.Text = "00"
.Font.Name = "Arial"
.Font.Size = 8
'.Font.Bold = True 'Gras
'.Font.ColorIndex = 55
.HorizontalAlignment = xlCenter
.VerticalAlignment = xlCenter
.ReadingOrder = xlContext
.Orientation = xlHorizontal
.Name = "monshape" & x
End With
End Sub


--
Cordialement
Guy

5 réponses

Avatar
MichDenis
Sub Heures()

With Worksheets(1)
.Activate
hcel = ActiveCell.Height / 2
Lcel = ActiveCell.Width * 2
PosHt = ActiveCell.Top
posLHt = ActiveCell.Left
x = .Shapes.Count + 1
With .Shapes.AddTextbox(msoTextOrientationHorizontal, _
posLHt, PosHt, Lcel, hcel)
.Name = "monshape" & x
.Fill.Visible = msoFalse
.Line.Visible = msoFalse
With .OLEFormat.Object
.Text = "00"
.Font.Name = "Arial"
.Font.Size = 8
'.Font.Bold = True 'Gras
'.Font.ColorIndex = 55
.HorizontalAlignment = xlCenter
.VerticalAlignment = xlCenter
.ReadingOrder = xlContext
.Orientation = xlHorizontal
End With
End With
End With
End Sub
Avatar
Guy72
Bonjour
Si j'ai bien compris.
Dans ce code, la Shape prends deux cellules jointes horizontalement (Lcel =
ActiveCell.Width * 2) ainsi que la moitié haute des cellules.( hcel =
ActiveCell.Height / 2)

Ma question est :
Comment faire pour que la Shape prenne la moitié inférieure des cellules
.( hcel = ActiveCell.Height ? )?
Merci de ton aide.
--
Cordialement
Guy

"MichDenis" a écrit dans le message de news:
OKzln%
Sub Heures()

With Worksheets(1)
.Activate
hcel = ActiveCell.Height / 2
Lcel = ActiveCell.Width * 2
PosHt = ActiveCell.Top
posLHt = ActiveCell.Left
x = .Shapes.Count + 1
With .Shapes.AddTextbox(msoTextOrientationHorizontal, _
posLHt, PosHt, Lcel, hcel)
.Name = "monshape" & x
.Fill.Visible = msoFalse
.Line.Visible = msoFalse
With .OLEFormat.Object
.Text = "00"
.Font.Name = "Arial"
.Font.Size = 8
'.Font.Bold = True 'Gras
'.Font.ColorIndex = 55
.HorizontalAlignment = xlCenter
.VerticalAlignment = xlCenter
.ReadingOrder = xlContext
.Orientation = xlHorizontal
End With
End With
End With
End Sub



Avatar
Guy72
Bonjour
Si j'ai bien compris.
Dans ce code, la Shape prends deux cellules jointes horizontalement (Lcel =
ActiveCell.Width * 2) ainsi que la moitié haute des cellules.( hcel =
ActiveCell.Height / 2)

Ma question est :
Comment faire pour que la Shape prenne la moitié inférieure des cellules
.( hcel = ActiveCell.Height ? )?
Merci de ton aide.
--
Cordialement
Guy

"MichDenis" a écrit dans le message de news:
OKzln%
Sub Heures()

With Worksheets(1)
.Activate
hcel = ActiveCell.Height / 2
Lcel = ActiveCell.Width * 2
PosHt = ActiveCell.Top
posLHt = ActiveCell.Left
x = .Shapes.Count + 1
With .Shapes.AddTextbox(msoTextOrientationHorizontal, _
posLHt, PosHt, Lcel, hcel)
.Name = "monshape" & x
.Fill.Visible = msoFalse
.Line.Visible = msoFalse
With .OLEFormat.Object
.Text = "00"
.Font.Name = "Arial"
.Font.Size = 8
'.Font.Bold = True 'Gras
'.Font.ColorIndex = 55
.HorizontalAlignment = xlCenter
.VerticalAlignment = xlCenter
.ReadingOrder = xlContext
.Orientation = xlHorizontal
End With
End With
End With
End Sub



Avatar
Modeste
Bonsour® Guy72 avec ferveur ;o))) vous nous disiez :

Si j'ai bien compris.
Dans ce code, la Shape prends deux cellules jointes horizontalement
(Lcel = ActiveCell.Width * 2) ainsi que la moitié haute des
cellules.( hcel = ActiveCell.Height / 2)

Ma question est :
Comment faire pour que la Shape prenne la moitié inférieure des
cellules .( hcel = ActiveCell.Height ? )?



PosHt = ActiveCell.Top + hcel

--
@+
;o)))
Avatar
Guy72
Encore merci Modeste
--
Cordialement
Guy

"Modeste" a écrit dans le message de news:
eht%
Bonsour® Guy72 avec ferveur ;o))) vous nous disiez :

Si j'ai bien compris.
Dans ce code, la Shape prends deux cellules jointes horizontalement
(Lcel = ActiveCell.Width * 2) ainsi que la moitié haute des
cellules.( hcel = ActiveCell.Height / 2)

Ma question est :
Comment faire pour que la Shape prenne la moitié inférieure des
cellules .( hcel = ActiveCell.Height ? )?



PosHt = ActiveCell.Top + hcel

--
@+
;o)))