Saltar al contenido
View in the app

A better way to browse. Learn more.

Ayuda Excel

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Conocer el alto de la Hoja y posición vertical del scroll

publicado

Buen día, tengo la siguiente pregunta, tengo un shape en la hoja y al hacer click en este, quiero insertar otro shape, la cosa es que este segundo shp quiero que aparezca dentro del área visible de la hoja, el segundo shape debería aparecer debajo del primero, pero si el primero esta muy abajo el segundo debería mostrarse por enzima del primero para que quede en el área visible de la hoja. pongo una imagen a continuación

image.png.6190f59c641903f524bec450f8970556.png

en el primer cuadro se muestra bien en el segundo es como no quisiera que salga, y el tercero la solución para el segundo cuadro

ahora bien a la hora de insertar tendría que preguntar

if shape1.top + shape1.height + shape2.height - hoja.VerticalScroll.pos > hoja.Height then ....

la cosa es que no existen las propiedades hoja.height y hoja.VerticalScroll, sugerencias?

 

 

Featured Replies

publicado

Investiga sobre Window.Scroll.Row y ShapeRange.TopLeftcell.Row

 

 

publicado
  • Autor

perfecto Antoni, asi quedo

Option Explicit

Public Sub MostrarShape()
    Dim Shape2 As Shape
    Const NewShapeHeight = 200
    Dim lTop As Long
    On Error Resume Next
    ActiveSheet.Shapes("Shape2").Delete
    With ActiveSheet.Shapes("Shape1")
        lTop = .Top + .Height - ActiveSheet.Cells(Application.ActiveWindow.ScrollRow, 1).Top
        If lTop + NewShapeHeight > ActiveWindow.VisibleRange.Rows.Height Then
            Set Shape2 = ActiveSheet.Shapes.AddShape(msoShapeRectangle, .Left, .Top - NewShapeHeight, .Width, NewShapeHeight)
        Else
            Set Shape2 = ActiveSheet.Shapes.AddShape(msoShapeRectangle, .Left, .Top + .Height, .Width, NewShapeHeight)
        End If
        Shape2.Fill.ForeColor.RGB = vbRed
        Shape2.Name = "Shape2"

        
    End With
End Sub

Muchas Gracias!

Archivado

Este tema está ahora archivado y está cerrado a más respuestas.

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.