Crear hojas según una lista de datos y con un formato especifico, y variación de funciones

Charcan

New Member
Joined
Mar 2, 2014
Messages
1
Veamos si me pueden ayudar, realmente les estare mil veces agradecido por la ayuda que me puedan brinda.

Esta es la cuestión tengo una lista en la "hoja 1", de esa lista deseo crear tantas hojas como nombres haya en esa lista, hasta aqui no hay problema tengo un macro que me hace exactamente eso, sino que cuando crea las hojas las nombra como en la lista y con el formato de la "hoja 2" ahora mi problema consiste en que la "hoja 2" tiene varias formulas en diferentes celdas las cuales se copian con éxito en las hojas creadas por el macro, pero como hago para hacer variaciones en esos códigos automaticamente por ejemplo si en la "hoja 2" celda "A3" tengo la siguiente formula =hoja1!AF11 como hago para que en las hojas que cree mi macro se modifique a =hoja1!AF12, y en la siguiente =hoja1!AF13

aqui les dejo el código que estoy usando:

Sub CopiarHojaFormato()


Application.ScreenUpdating = False
Dim celda As Range
For Each celda In Worksheets("Nomina24h").Range("ai11:ai24")
Worksheets("1").Copy After:=Worksheets(Worksheets.Count)
ActiveSheet.Name = celda
Range("a1").Value = celda
Next

End Sub


espero haberme hecho entender

Muchas gracias de antemano
 

Excel Facts

Easy bullets in Excel
If you have a numeric keypad, press Alt+7 on numeric keypad to type a bullet in Excel.
Hola Charcan,

Sub CopiarHojaFormato()


Application.ScreenUpdating = False
Dim celda As Range
dim lngContador as long

lngContador = 1
For Each celda In Worksheets("Nomina24h").Range("ai11:ai24")
Worksheets("1").Copy After:=Worksheets(Worksheets.Count)
ActiveSheet.Name = celda
Range("a" & lngContador).Value = celda
lngContador=lngContador+1
Next

End Sub

Esto hace que a cada nueva hoja el valor de la celda se escribe más abajo.

Espero ter ayudado, e perdóname mi malo castellano.

Vândalo
 
Upvote 0

Forum statistics

Threads
1,215,069
Messages
6,122,952
Members
449,095
Latest member
nmaske

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top