Propiedad Range.LocationInTable (Excel)

Devuelve una constante que describe la parte del informe de tabla dinámica que contiene la esquina superior izquierda del intervalo especificado. Puede ser una de las siguientes constantes XlLocationInTable . Long de sólo lectura.

Sintaxis

expresión. LocationInTable

expresión Variable que representa un objeto Range.

Ejemplo:

Este ejemplo muestra un cuadro de texto que describe la ubicación de la celda activa en el informe de tabla dinámica.

Worksheets("Sheet1").Activate 
Select Case ActiveCell.LocationInTable 
Case Is = xlRowHeader 
 MsgBox "Active cell is part of a row header" 
Case Is = xlColumnHeader 
 MsgBox "Active cell is part of a column header" 
Case Is = xlPageHeader 
 MsgBox "Active cell is part of a page header" 
Case Is = xlDataHeader 
 MsgBox "Active cell is part of a data header" 
Case Is = xlRowItem 
 MsgBox "Active cell is part of a row item" 
Case Is = xlColumnItem 
 MsgBox "Active cell is part of a column item" 
Case Is = xlPageItem 
 MsgBox "Active cell is part of a page item" 
Case Is = xlDataItem 
 MsgBox "Active cell is part of a data item" 
Case Is = xlTableBody 
 MsgBox "Active cell is part of the table body" 
End Select

Soporte técnico y comentarios

¿Tiene preguntas o comentarios sobre VBA para Office o esta documentación? Vea Soporte técnico y comentarios sobre VBA para Office para obtener ayuda sobre las formas en las que puede recibir soporte técnico y enviar comentarios.