Saltar al contenido
PROGRAMAR EN VBA MACROS DE EXCEL

Funciones Definidas por el Usuario de Excel

(adsbygoogle = window.adsbygoogle || []).push({});

Cuando se trabaja  con Excel, ya sea que se trabajé con fórmulas o se programe macros para excel, es imprescindible saber que es lo que específicamente realiza cada una de las fórmula que trae Excel su arsenal de herramientas para trabajar con datos  numéricos y de texto, Excel clasifica las fórmulas en:
1 Funciones de Excel Financieras
Funciones de Excel de Fecha y Hora
Funciones de Excel Matemáticas y Trigonométricas
Funciones de Excel Estadísticas
Funciones de Excel de  Búsqueda y Referencia
Funciones de Excel de Base de Datos
Funciones de Excel de Texto
Funciones de Excel Lógicas
Funciones de Excel de Información
10 Funciones de Excel Definidas por  el Usuario
11 Funciones de Excel de Ingeniería
12 Funciones de Excel de Cubo
Te recomiendo que leas un excelente libro sobre Excel el que te ayudará manejar las planillas de cálculo, debes hacer click acá.
  
En post anteriores se presentaron otro tipos de funciones que trae incorporado Excel, ahora voy a mostrarte como se agregaa Excel una funciones definidas por el usuario; se puede incorporar cualquier función que el usuario realice, desde una función simple hasta complejos cálculos, en este blog existen varias funciones que son definidas por el usuario, explicándose detalladamente como se debe incorporar a Excel, para que éste permita usarlas, un ejemplo de función, es la que permite convertir números a letra, siendo bastante utilizada; también en convertir número a letra función definida por el usuario  encontrarás otra función semejante a  la anterior; seguidamente se ve una parte del desarrollo de la función.

Private Function Unidades(num, UNO)
Dim U
Dim Cad
   
    U =
Array(«un», «dos», «tres», «cuatro», «cinco», «seis», «siete», «ocho»,
«nueve»)
    Cad = «»
    If num = 1 Then
        If UNO = 1
Then
            Cad = Cad & «uno»
        Else
            Cad =
Cad & «un»
        End If
    Else
        Cad = Cad & U(num –
1)
    End If
    Unidades = Cad
End Function
Private Function
Decenas(num1, res)
Dim D1
    D1 = Array(«once», «doce», «trece»,
«catorce», «quince», «dieciseis«,
«diecisiete», _
                «dieciocho», «diecinueve»)
    D2 =
Array(«diez», «veint», «treinta», «cuarenta», «cincuenta», «sesenta»,
_
                «setenta», «ochenta», «noventa»)
   
    If num1
> 10 And num1 < 20 Then
        Cad1 = D1(num1 – 10 – 1)
   
Else
        Cad1 = D2((num1 10) – 1)
        If (num1 10) <> 2
Then
            If res > 0 Then
                Cad1 = Cad1 & » y
«
                Cad1 = Cad1 & Unidades(num1 Mod 10, 0)
           
End If
        Else
            If res = 0 Then
                Cad1 =
Cad1 & «e»
            Else
                Cad1 = Cad1 &
«i»
                Cad1 = Cad1 & Unidades(num1 Mod 10, 0)
           
End If
        End If
    End If
    Decenas = Cad1
End
Function
Private Function Cientos(num2)
   num3 = num2 100
    Select Case num3
        Case
1
                If num2 = 100 Then
                    cad2 = «cien
«
                Else
                    cad2 = «ciento
«
                End If
        Case 5
                cad2 =
«quinientos «
        Case 7
                cad2 = «setecientos
«
        Case 9
                cad2 = «novecientos «
        Case Else
                cad2 =
Unidades(num3, 0) & «cientos «
    End Select
   
    num2 = num2
Mod 100
    If num2 > 0 Then
        If num2 < 10
Then
            cad2 = cad2 & Unidades(num2, num2)
       
Else
            cad2 = cad2 & Decenas(num2, num2 Mod 10)
        End
If
    End If
    Cientos = cad2
End Function
Private Function
Miles(num4)
    If (num4 >= 100) Then
        cad3 =
Cientos(num4)
    Else

        If
(num4 >= 10) Then
            cad3 = Decenas(num4, num4 Mod 10)
       
Else
            cad3 = Unidades(num4, 0)
        End If
    End
If
    cad3 = cad3 & » mil «
    Miles = cad3
End
Function
Private Function Millones(cant)
    If cant = 1 Then
       
ter = » «
    Else
        ter = «es «
    End If
    If (cant >=
1000) Then
        cantl = cantl & Miles(cant 1000

Seguir leyendo …

El siguiente video explica como se debe guardar el archivo con la función realizada por el usuario y la forma de incorporarla a Excel para que aparezca en el listados de funciones de Excel.

Si te gustó por favor compártelo con tus amigos
If you liked please share it with your friends      

Entradas relacionadas

Deja un comentario

Tu dirección de correo electrónico no será publicada. Los campos obligatorios están marcados con *

Comentarios (30)

I’m the co-founder of JustCBD company (justcbdstore.com) and I’m presently trying to grow my wholesale side of business. I am hoping someone at targetdomain can help me . I thought that the most effective way to do this would be to talk to vape stores and cbd stores. I was hoping if someone could suggest a dependable web site where I can get CBD Shops B2B Marketing List I am already examining creativebeartech.com, theeliquidboutique.co.uk and wowitloveithaveit.com. Not exactly sure which one would be the most ideal solution and would appreciate any guidance on this. Or would it be easier for me to scrape my own leads? Suggestions?

Responder

Если по ООО есть долги, в силу различных обстоятельств вы не можете их погасить, то тут только субсидиарная ответственность

Responder

This is a topic that is close to my heart… Take care! Exactly where are your contact details though?

Responder

I’m very pleased to find this site. I wanted to thank you for your time for this fantastic read!! I definitely enjoyed every part of it and I have you saved to fav to see new stuff on your site.

Responder

You are so cool! I don’t think I’ve truly read a single thing like that before. So wonderful to find somebody with some genuine thoughts on this topic. Really.. thank you for starting this up. This web site is something that is needed on the internet, someone with a bit of originality!

Responder

I quite like reading a post that will make men and women think. Also, many thanks for allowing for me to comment!

Responder

This is a great tip particularly to those fresh to the blogosphere. Short but very accurate info… Many thanks for sharing this one. A must read article!

Responder

Good post. I learn something totally new and challenging on websites I stumbleupon every day. It’s always interesting to read through content from other writers and use something from other sites.

Responder

I really love your blog.. Pleasant colors & theme. Did you create this amazing site yourself? Please reply back as I’m planning to create my own personal blog and would love to know where you got this from or exactly what the theme is called. Thank you!

Responder

There is certainly a lot to learn about this subject. I like all of the points you made.

Responder

I used to be able to find good info from your blog posts.

Responder

Way cool! Some very valid points! I appreciate you penning this write-up and the rest of the site is also really good.

Responder

This excellent website truly has all the information and facts I wanted about this subject and didn’t know who to ask.

Responder

I must thank you for the efforts you have put in penning this website. I am hoping to check out the same high-grade content from you in the future as well. In fact, your creative writing abilities has encouraged me to get my own, personal blog now 😉

Responder

May I simply say what a comfort to discover someone who actually knows what they are discussing over the internet. You definitely realize how to bring a problem to light and make it important. More people have to read this and understand this side of the story. I was surprised that you’re not more popular since you definitely possess the gift.

Responder

Saved as a favorite, I really like your web site!

Responder

Having read this I thought it was rather enlightening. I appreciate you spending some time and energy to put this information together. I once again find myself spending a significant amount of time both reading and leaving comments. But so what, it was still worth it!

Responder

I’m impressed, I have to admit. Seldom do I encounter a blog that’s both educative and engaging, and without a doubt, you have hit the nail on the head. The issue is something not enough men and women are speaking intelligently about. I am very happy that I came across this during my hunt for something concerning this.

Responder

You should be a part of a contest for one of the finest blogs on the net. I’m going to highly recommend this web site!

Responder

bookmarked!!, I like your blog!

Responder

After I originally commented I seem to have clicked the -Notify me when new comments are added- checkbox and from now on whenever a comment is added I get 4 emails with the exact same comment. Perhaps there is a means you can remove me from that service? Many thanks!

Responder

I’ve been browsing online higher than 3 hours today, but I
never discovered any interesting article like yours. It’s pretty price sufficient in my opinion. In my opinion, if all webmasters and bloggers made
just right content as it is likely you did, the net could
possibly be a lot more useful than ever before.

Also visit my webpage :: LouraFGeimer

Responder

Good web site you’ve got here.. It’s difficult to find excellent writing like yours nowadays. I seriously appreciate individuals like you! Take care!!

Responder

That is a great tip particularly to those fresh to the blogosphere. Short but very accurate information… Appreciate your sharing this one. A must read article!

Responder

This is a really good tip particularly to those fresh to the blogosphere. Simple but very accurate info… Appreciate your sharing this one. A must read article!

Responder

Hi there! This post couldn’t be written any better! Looking through this article reminds me of my previous roommate! He always kept talking about this. I most certainly will forward this information to him. Pretty sure he’ll have a great read. I appreciate you for sharing!

Responder

It is not my first time to pay a quick visit this site, i am visiting this web
page dailly and get fastidious data from here every day.

Responder

Aw, this was a very good post. Finding the time and actual effort to create a superb article… but what can I say… I hesitate a lot and don’t seem to get nearly anything done.

Responder

May I just say what a relief to find somebody who actually knows what they’re talking about on the internet. You certainly realize how to bring a problem to light and make it important. More people must read this and understand this side of the story. It’s surprising you’re not more popular since you certainly have the gift.

Responder

Good web site you have got here.. It’s hard to find quality writing like yours these days. I honestly appreciate people like you! Take care!!

Responder