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.

COMO ASIGNAR CADA DIA DE UN CALEDARIO A CADA HOJA

publicado

Hola un cordial saludo a todos.

 Tengo una hoja con un formato de calendario y tengo 365 hojas cada una con nombre de un dia mes y año  en especifico agradecería me ayuden a como puedo realizar la vinculacion de cada dia del calendario con cada hoja respectivamente sin hacerlo de forma manual , ya que es muy laborioso dado que lo tengo que hacer de una por una.

 

adjunto coloco un ejemplo de lo que tengo gracias.

Libro1.xlsm

Featured Replies

publicado

Abre el adjunto y pulsa el botón  GENERAR HOJAS y luego pulsa sobre cualquier fecha del calendario para ir a la hoja deseada.

Observa que he añadido 2 botones en la hoja CALENDARIO, uno para generar las hojas y otro para eliminarlas.

También he añadido una flechita azul en las hojas generadas para volver a la hoja CALENDARIO.

Estas son las macros:

En la hoja CALENDARIO:

Private Sub Worksheet_SelectionChange(ByVal Target As Range)
Dim d As Integer, m As Integer, a As Integer
On Error Resume Next
If IsNumeric(Target) Then
   If Not Target = "" Then
      x = Int((Target.Row - 6) / 9)
      y = Int((Target.Column - 5) / 8) + 1
      m = x * 6 + y
      d = Target
      a = Right([E3], 4)
      Sheets(Format(d, "00") & "-" & Format(m, "00") & "-" & a).Activate
   End If
End If
End Sub

En el Módulo1:

Sub GenerarHojas()
Application.ScreenUpdating = False
Application.CopyObjectsWithCells = True
Dim a As Integer
a = Right([E3], 4)
With Sheets("ORIGI")
   For fecha = CDate("01/01/" & a) To CDate("31/12/" & a) '<-- Periodo a generar
      .Copy After:=Sheets(Sheets.Count)
      ActiveSheet.Name = Format(fecha, "dd-mm-yyyy")
      [B4] = [B4] & " " & fecha
   Next
End With
Volver
End Sub
'--
Sub EliminarHojas(): On Error Resume Next
Application.ScreenUpdating = False
Application.DisplayAlerts = False
Dim a As Integer
a = Right([E3], 4)
For fecha = CDate("01/01/" & a) To CDate("31/12/" & a) '<-- Periodo a eliminar
   Sheets(Format(fecha, "dd-mm-yyyy")).Delete
Next
End Sub
'--
Sub Volver()
Sheets("CALENDARIO").Activate
End Sub

 

Libro1 (15).xlsm

Editado el por Antoni

publicado
  • Autor

Muchas gracias me a servido de mucho su colaboaracion y ayuda.

 

Excelente aporte amigo.

  • 3 weeks later...
publicado
  • Autor
En 16/4/2024 at 4:56 , Antoni dijo:

Abre el adjunto y pulsa el botón  GENERAR HOJAS y luego pulsa sobre cualquier fecha del calendario para ir a la hoja deseada.

Observa que he añadido 2 botones en la hoja CALENDARIO, uno para generar las hojas y otro para eliminarlas.

También he añadido una flechita azul en las hojas generadas para volver a la hoja CALENDARIO.

Estas son las macros:

En la hoja CALENDARIO:

Private Sub Worksheet_SelectionChange(ByVal Target As Range)
Dim d As Integer, m As Integer, a As Integer
On Error Resume Next
If IsNumeric(Target) Then
   If Not Target = "" Then
      x = Int((Target.Row - 6) / 9)
      y = Int((Target.Column - 5) / 8) + 1
      m = x * 6 + y
      d = Target
      a = Right([E3], 4)
      Sheets(Format(d, "00") & "-" & Format(m, "00") & "-" & a).Activate
   End If
End If
End Sub

En el Módulo1:

Sub GenerarHojas()
Application.ScreenUpdating = False
Application.CopyObjectsWithCells = True
Dim a As Integer
a = Right([E3], 4)
With Sheets("ORIGI")
   For fecha = CDate("01/01/" & a) To CDate("31/12/" & a) '<-- Periodo a generar
      .Copy After:=Sheets(Sheets.Count)
      ActiveSheet.Name = Format(fecha, "dd-mm-yyyy")
      [B4] = [B4] & " " & fecha
   Next
End With
Volver
End Sub
'--
Sub EliminarHojas(): On Error Resume Next
Application.ScreenUpdating = False
Application.DisplayAlerts = False
Dim a As Integer
a = Right([E3], 4)
For fecha = CDate("01/01/" & a) To CDate("31/12/" & a) '<-- Periodo a eliminar
   Sheets(Format(fecha, "dd-mm-yyyy")).Delete
Next
End Sub
'--
Sub Volver()
Sheets("CALENDARIO").Activate
End Sub

 

Libro1 (15).xlsm 37.94 kB · 3 descargas

amigo antoni necesito de su ayuda con otro archivo de excel el cual no puedo subir por que pesa mas de 4 mb

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.