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.

Utilizar valor de una variable en una función

publicado

Hola a todos, quisiera saber como poder utilizar en una forma una variable que con tiene el nombre de una hoja de Excel. Por ejemplo en vez de que diga el nombre de la hoja esté el valor de la variable. Saludos!

Cita

Sub Prueba_HojaYFilaVariable()
    
    NH = "Hoja1"
    Range("A2").Formula = "=CONCATENATE(Hoja1!A6,Hoja1!B6)"
    
End Sub

 

 

Featured Replies

publicado

Hola

Siguiendo con tu misma idea:

Sub Prueba_HojaYFilaVariable()
    
    Dim NH As String
    NH = "Hoja1"
    Range("A2").Formula = "=CONCATENATE(" & NH & "!A6," & NH & "!B6)"
    
End Sub

Saludos

Abraham Valencia

PD: Cuando se trata de variables hay otras formas también

publicado

Otra forma que es la que utilizo y que habitualmente veo que no es muy utilizada, es la siguiente:

Dim mh As Worksheet: Set mh = Hoja1
va6 = mh.Range("A6").Address(, , , 1)
vb6 = mh.Range("B6").Address(, , , 1)
VBA.MsgBox va6
VBA.MsgBox vb6
Set mh = Nothing

 

Hace 23 minutos , avalencia dijo:

PD: Cuando se trata de variables hay otras formas también

@avalencia conoces otros métodos?

 

Saludos a ambos!

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.