REALIZAR UN CONTADOR

Rocky

New Member
Joined
Jul 4, 2002
Messages
13
Saludos a todos, mi consulta es la siguiente:

Necesito numerar cada vez que grabo una hoja con un número que aumenta de uno en uno (inicia de 001), preferiblemente que sea con algún macro, debido a que no lo podría manejar con programación en VB.

Este número va en una celda en particular: N3

Muchas gracias, :cool: :cool: :cool:
 

Excel Facts

What is the fastest way to copy a formula?
If A2:A50000 contain data. Enter a formula in B2. Select B2. Double-click the Fill Handle and Excel will shoot the formula down to B50000.
En Excel, hacer click derecho sobre el icono del libro, al lado del menu "Archivo". Ahí, se selecciona "Ver código".

Una vez en VBE, seleccionar "Workbook" de la primera lista, y "BeforeSave" de la segunda.

Entre las dos líneas que aparecen, se debe poner el código:

Code:
With ThisWorkbook.Sheets("MiHoja")
    .Range("N3").Value = .Range("N3").Value + 1
End With

Donde "MiHoja" es el nombre de la hoja que contiene el contador.
 
Upvote 0
Muchisimas gracias, funcionó perfectamente....

Aprovecho para consultarte algo que estoy llevando con este mismo proyecto:

Al grabar cambia el contador, perfecto...!!!, pero tengo el detalle de algunos códigos que extraigo en otras celdas con vlookup, por ejemplo cantidad: Como ya los he utilizado necesito que me limpie las celdas (B10..B39) y (C10..C39).

Al utilizar el vlookup, necesito también dejar en blanco cuando no encuentra el código que busco y eliminar el N/A (D10..D39) y (E10..E39).

De nuevo muchas gracias y felicitaciones.
 
Upvote 0
ya solucioné el problema con una función dentro del Vlookup, talvez a alguien que no lo sepa le interese:

=IF(ISBLANK(B10),"",VLOOKUP(B10,Inventario!$A$1:$C$31,2,0))

Gracias,

:biggrin: :biggrin: :biggrin: :biggrin: :biggrin:
 
Upvote 0

Forum statistics

Threads
1,214,611
Messages
6,120,510
Members
448,967
Latest member
screechyboy79

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