Skip to content

Instantly share code, notes, and snippets.

View jvmonjo's full-sized avatar
👨‍💻
Trying not to work too much

Josep jvmonjo

👨‍💻
Trying not to work too much
View GitHub Profile
Public Function calculaTrienis(ingres As Date) As Integer
Dim anys As Integer
anys = Int((Date - ingres) / 365.25)
calculaTrienis = Fix(anys / 3)
End Function
Public Function calculaAnys(dataOrigen As Date) As Integer
calculaAnys = Int((Date - dataOrigen) / 365.25)
End Function
Public Function Validar_NIF(ByVal nif As String) As Boolean
Dim aux As String
nif = UCase(nif) 'ponemos la letra en mayuscula
aux = Mid(nif, 1, Len(nif) - 1) 'quitamos la letra del nif
If Len(aux) >= 7 And IsNumeric(aux) Then
aux = Calcular_NIF(aux, False) 'calculamos la letra del NIF para comparar con la que tenemos
Else
MsgBox ("El dato introducido no corresponde a un NIF")
Validar_NIF = False
@jvmonjo
jvmonjo / designer.html
Last active August 29, 2015 14:10
designer
<link rel="import" href="../core-scaffold/core-scaffold.html">
<link rel="import" href="../core-header-panel/core-header-panel.html">
<link rel="import" href="../core-menu/core-menu.html">
<link rel="import" href="../core-item/core-item.html">
<link rel="import" href="../core-icon-button/core-icon-button.html">
<link rel="import" href="../core-toolbar/core-toolbar.html">
<link rel="import" href="../core-menu/core-submenu.html">
<polymer-element name="my-element">
@jvmonjo
jvmonjo / designer.html
Last active August 29, 2015 14:09
designer
<link href="../core-drawer-panel/core-drawer-panel.html" rel="import">
<link href="../core-menu/core-submenu.html" rel="import">
<link href="../core-item/core-item.html" rel="import">
<link href="../topeka-elements/avatars.html" rel="import">
<link href="../core-icon/core-icon.html" rel="import">
<polymer-element name="my-element">
<template>
<style>