Saltar al contenido principal

¿Cómo crear un código qr basado en el valor de la celda en Excel?

¿Sabe cómo crear un código QR basado en un valor de celda específico en Excel? Este artículo le mostrará un método para lograrlo en detalle.

Cree un código QR basado en el valor de la celda con control de código de barras y código VBA
Cree fácilmente múltiples códigos QR a granel basados ​​en valores de celda con una herramienta increíble


Cree un código QR basado en el valor de la celda con control de código de barras y código VBA

El control de código de barras puede ayudarlo a crear rápidamente un código QR basado en el valor de la celda en Excel. Haz lo siguiente.

1. Abra la hoja de trabajo que contiene el valor de celda en el que creará el código QR.

2. Hacer clic en Developer > recuadro > Mas control. Ver captura de pantalla:

3. En el Más controles ventana, compruebe el Control de código de barras de Microsoft 16.0 or Control de código de barras de Microsoft 15.0.

4. Si no encontró el control de código de barras en la ventana Más controles o si el control de código de barras no es 16.0 o 15.0, debe descargar el archivo de control de código de barras haciendo clic en estos enlaces: descargar control de código de barras. Si hay Control de código de barras 16.0 o 15.0 en su ventana Más controles, simplemente vaya a la siguiente paso 10.

Después de descargar el archivo, descomprímalo y luego actualice el control de código de barras con el control de código de barras descargado en su Excel de la siguiente manera.

5. Cierre todos sus libros de Excel, vaya al Inicio sección, encuentre el Excel aplicación y haga clic derecho en ella, luego seleccione Ejecutar como administrador desde el menú contextual. Ver captura de pantalla:

6. En la apertura Control de cuentas de usuario cuadro de diálogo, haga clic en del botón.

7. Luego se crea un nuevo libro de trabajo. Por favor haz click Developer > recuadro > Mas control. Ver captura de pantalla:

8. En el Más controles ventana, haga clic Registro personalizado , busque y seleccione uno de los archivos OCX de código qr descargados y luego haga clic en el botón Abierto botón. Ver captura de pantalla:

9. Haga clic en el OK botón cuando devuelve el Más controles ventana para finalizar el Control de código de barras actualizado. Luego, vuelva a abrir el libro de trabajo que contiene los valores de celda en los que creará los códigos QR.

10. Haga clic derecho en la pestaña de la hoja y haga clic en Ver código desde el menú contextual para abrir el Microsoft Visual Basic para aplicaciones ventana. Luego copie y pegue debajo del código VAB en la ventana Código. Y finalmente presione el otro + Q llaves para salir del Microsoft Visual Basic para aplicaciones ventana.

Código VBA: cree código QR en Excel

Sub setQR()
'Updated by Extendoffice 2018/8/22
    Dim xSRg As Range
    Dim xRRg As Range
    Dim xObjOLE As OLEObject
    On Error Resume Next
    Set xSRg = Application.InputBox("Please select the cell you will create QR code based on", "Kutools for Excel", , , , , , 8)
    If xSRg Is Nothing Then Exit Sub
    Set xRRg = Application.InputBox("Select a cell to place the QR code", "Kutools for Excel", , , , , , 8)
    If xRRg Is Nothing Then Exit Sub
    Application.ScreenUpdating = False
    Set xObjOLE = ActiveSheet.OLEObjects.Add("BARCODE.BarCodeCtrl.1")
    xObjOLE.Object.Style = 11
    xObjOLE.Object.Value = xSRg.Text
    ActiveSheet.Shapes.Item(xObjOLE.Name).Copy
    ActiveSheet.Paste xRRg
    xObjOLE.Delete
    Application.ScreenUpdating = True
End Sub

11. Hacer clic en Developer > recuadro > Botón (Control de formulario) como se muestra a continuación.

12. Dibuje un botón en la hoja de trabajo actual. En el apareciendo Asignar macro diálogo, seleccionar establecerQR en el cuadro y luego haga clic en el OK del botón.

13. Apaga el Modo de diseño haciendo click Developer > Modo de diseño.

14. Haga clic en el botón, en la apertura Kutools for Excel cuadro de diálogo, seleccione la celda en la que creará el código QR y haga clic en OK.

15. En el segundo Kutools for Excel cuadro de diálogo, seleccione una celda para colocar el código QR. Ver captura de pantalla:

Luego, el código QR se insertará en la celda especificada de inmediato. Repita los pasos 14 a 15 para finalizar todos los códigos QR creados. Ver captura de pantalla:


Cree fácilmente múltiples códigos QR a granel basados ​​en valores de celda con una herramienta increíble

Para ser honesto, el método anterior no es fácil de manejar ya que tiene sus propias limitaciones. Aquí muy recomendado el Insertar código QR característica de Kutools for Excel. Esta función puede ayudarlo a insertar rápidamente códigos QR a granel según los valores de celda especificados en Excel con solo varios clics. Haga lo siguiente para hacerlo.

Antes de aplicar Kutools for Excel, Por favor descargarlo e instalarlo en primer lugar.

1. En primer lugar, prepare los valores en los que desea crear el código QR.

2. Hacer clic en Kutools > recuadro > Insertar código QR.

Consejos: Si no puede encontrar la función con esta ruta, presione el otro + S teclas simultáneamente para abrir el Buscar funciones de Kutools cuadro, escriba manualmente Código QR en el cuadro de búsqueda, puede ver el Insertar código QR la función aparece en la lista, simplemente haga clic para activar la función. Ver captura de pantalla:

Ahora se muestra el panel Insertar código QR en el lado derecho del libro de trabajo.

3. En el Insertar código QR panel, debe configurarlo de la siguiente manera.

3.1) en el Rango de datos cuadro, seleccione el rango de celdas que contienen los valores en los que desea crear el código QR;
3.2) en el Insertar rango cuadro, seleccione un rango de celdas en blanco para generar el código QR;
3.3) en el Opciones seccion, configurar el tamaño, color de línea, color de fondo y Nivel de corrección de errores para el código QR que necesite;
Nota: El tamaño del código QR no puede superar los 500 píxeles.
3.4) Haga clic en Generar botón. Ver captura de pantalla:

4. Entonces un Kutools for Excel aparece el cuadro de diálogo, haga clic en DE ACUERDO.

5. Luego, los códigos QR se crean al mismo tiempo. Necesita cerrar manualmente el Insertar código QR panel si termina de crear todos los códigos QR.

Haga clic para saber más sobre esta función ...


Artículo relacionado:

Las mejores herramientas de productividad de oficina

🤖 Asistente de IA de Kutools: Revolucionar el análisis de datos basado en: Ejecución inteligente   |  Generar codigo  |  Crear fórmulas personalizadas  |  Analizar datos y generar gráficos  |  Invocar funciones de Kutools...
Características populares: Buscar, resaltar o identificar duplicados   |  Eliminar filas en blanco   |  Combine columnas o celdas sin perder datos   |   Ronda sin fórmula ...
Super búsqueda: Búsqueda virtual de criterios múltiples    Búsqueda V de valores múltiples  |   VLookup en varias hojas   |   Búsqueda difusa ....
Lista desplegable avanzada: Crear rápidamente una lista desplegable   |  Lista desplegable dependiente   |  Lista desplegable de selección múltiple ....
Administrador de columnas: Agregar un número específico de columnas  |  Mover columnas  |  Toggle Estado de visibilidad de columnas ocultas  |  Comparar rangos y columnas ...
Características destacadas: Enfoque de cuadrícula   |  Vista de diseño   |   Gran barra de fórmulas    Administrador de hojas y libros de trabajo   |  Biblioteca de Recursos (Texto automático)   |  Selector de fechas   |  Combinar hojas de trabajo   |  Cifrar/descifrar celdas    Enviar correos electrónicos por lista   |  Súper filtro   |   Filtro especial (filtro negrita/cursiva/tachado...) ...
Los 15 mejores conjuntos de herramientas12 Texto Herramientas (Añadir texto, Quitar caracteres, ...)   |   50+ Tabla Tipos (Diagrama de Gantt, ...)   |   40+ Práctico Fórmulas (Calcular la edad según el cumpleaños, ...)   |   19 Inserción Herramientas (Insertar código QR, Insertar imagen desde la ruta, ...)   |   12 Conversión Herramientas (Números a palabras, Conversión de Moneda, ...)   |   7 Fusionar y dividir Herramientas (Filas combinadas avanzadas, Células partidas, ...)   |   ... y más

Mejore sus habilidades de Excel con Kutools for Excel y experimente la eficiencia como nunca antes. Kutools for Excel ofrece más de 300 funciones avanzadas para aumentar la productividad y ahorrar tiempo.  Haga clic aquí para obtener la función que más necesita...

Descripción


Office Tab lleva la interfaz con pestañas a Office y hace que su trabajo sea mucho más fácil

  • Habilite la edición y lectura con pestañas en Word, Excel, PowerPoint, Publisher, Access, Visio y Project.
  • Abra y cree varios documentos en nuevas pestañas de la misma ventana, en lugar de en nuevas ventanas.
  • ¡Aumenta su productividad en un 50% y reduce cientos de clics del mouse todos los días!
Comments (38)
No ratings yet. Be the first to rate!
This comment was minimized by the moderator on the site
Is it possible to make a payment qr code in excel?
f.e. In cell A1 I've an amout of 10 euro, and in cell B2 I want to have an qr code so anyone can pay me with the qr code?

Thanks.
This comment was minimized by the moderator on the site
Hi Ruben,

Thank you for reaching out with your question. While Kutools for Excel does feature QR code generation, creating a payment QR code directly in Excel for transactional purposes is beyond the scope of this feature. Payment QR codes usually require integration with financial services or payment platforms to ensure secure transactions. I recommend exploring services specifically designed for creating payment QR codes, such as those offered by banks or digital payment systems. These platforms can generate a QR code linked to your payment details securely. Once you have the payment QR code, you could then include it in your Excel document as an image.
This comment was minimized by the moderator on the site
Hello

The download link provided in step 4 appears to be only Microsoft Barcode Control 14.0. Can anyone suggest a correct link for 16.0 please?

Thank you.
This comment was minimized by the moderator on the site
1 Sheets waar in de cellen van de rij random QR codes binnen komen. Waarvan elke QR code automatisch de juiste Sheets openend?
Of de BVA commando codes van de Button om de koppeling maken naar een andere sheets.
Dan ben erg dankbaar voor.
(dit is voor vrijwilligerswerk)

Groetjes,
H. van Schaijk
This comment was minimized by the moderator on the site
Hi H. van Schaijk,
I can't fix this problem. Sorry about that.
This comment was minimized by the moderator on the site
Hi folks,
Below code works fine with me, which is linked to cell range & generates the QR at each row cell 5000 nos, however I would like to stop the QR object generation if the reference cell value is zero / otherway round should generate the QR at adjucent cell if the value at reference cell is more than zero or <>""

Please seek experts assistance!!

thank you in advance

Sub Gen_StockOut_QR()
MsgBox ("Will Generate QR Code for Stock_Out Items at In@Out Sheet")
Sheets("In@Out_Data").Select
ActiveSheet.Unprotect Password:=" "
'Column range set at QR_Code
Range("QR_Code").Select

For Each cell In Selection
'cell.Offset(0, 23).Select ' 1 indicates the position of excel column A1 from the formula/webaddress/site/characters to be used to generate QR code
cell.Offset(0, 0).Select

' My case QRCode is at column 24 hence 24 as column from A1, QR Size 100*100
FilePath = "http://chart.googleapis.com/chart?chs=100x100&&cht=qr&chl=" & WorksheetFunction.EncodeURL(cell.Value) ' here is the cell value

With ActiveSheet.Pictures.Insert(FilePath)
'.ShapeRange.ScaleWidth 0.95, msoFalse, msoScaleFromTopLeft
'.ShapeRange.ScaleHeight 0.95, msoFalse, msoScaleFromTopLeft

End With
Next cell
End Sub
This comment was minimized by the moderator on the site
Interesting article - thank you.  How do I remove the custom control from the list please?
This comment was minimized by the moderator on the site
Hi,Do you mean to remove the Form Control inserted in the VBA code method? If so, you just need to right click it (when there is a context menu listed, click anywhere outside it to hide the context menu), and then press Delete to remove it.
This comment was minimized by the moderator on the site
Olá! Para mim, nenhum dos comentários ou esse post funcionou corretamente, mas utilizando o Visual Basic com o código que deixarei abaixo funcionou, pois criou uma função para mim. E para usar a função é só abrir a planilha e digitar: "=QrCode("célula desejada")"




Function QrCode(codetext As String)
Dim URL As String, MyCell As Range
'Para gerar o código, precisa a máquina ter acesso a internet
Set MyCell = Application.Caller
URL = "https://chart.googleapis.com/chart?chs=150x150&cht=qr&chl=" & codetext
On Error Resume Next
ActiveSheet.Pictures("QR_" & MyCell.Address(False, False)).Delete
On Error GoTo 0
ActiveSheet.Pictures.Insert(URL).Select
With Selection.ShapeRange(1)
.PictureFormat.CropLeft = 15
.PictureFormat.CropRight = 15
.PictureFormat.CropTop = 15
.PictureFormat.CropBottom = 15
.Name = "QR_" & MyCell.Address(False, False)
.Left = MyCell.Left + 2
.Top = MyCell.Top + 2
End With
QrCode = ""
End Function
This comment was minimized by the moderator on the site
Wie lösche ich die QR Code Grafik wieder ? wenn ich mit den Skript Wie erstelle ich einen QR-Code basierend auf dem Zellenwert in Excel? einen QR Code erzeugt habe ?
This comment was minimized by the moderator on the site
Hi All,

I modified the VBA code for creation a multi QR codes from selection in excel column

Follow until step 10 then add this code

Sub setQR()

Dim xSRg As Range
Dim xRRg As Range
Dim xObjOLE As OLEObject
On Error Resume Next
Dim srcSelection As Range
Dim srcCell As String
For Each srcSelection In Application.Selection
Dim qrCelltoupdate As String
Dim qrTxt As String
qrCelltoupdate = srcSelection.Offset(0, 1).Address
qrTxt = srcSelection.Text
Worksheets("Sheet1").Range(qrCelltoupdate).Select
Application.ScreenUpdating = False
Set xObjOLE = ActiveSheet.OLEObjects.Add("BARCODE.BarCodeCtrl.1")
xObjOLE.Object.Style = 11
xObjOLE.Object.Value = qrTxt
ActiveSheet.Shapes.Item(xObjOLE.Name).Copy
ActiveSheet.Paste
xObjOLE.Delete
Next srcSelection
'Create Qr code from selection multi cells
End Sub


In step 12
Assign Macro
Chose: Sheet1.setQR

QR codes will be populated in next column

Hope that helps for you all
This comment was minimized by the moderator on the site
Hi ChavdarHarchev.
First of all thank You very much for Your nice work.

Is it possible for You to show how the VBA code looks like when it is finished?
Best regards
Pierre Galuszka.
This comment was minimized by the moderator on the site
Hi All,
I modified the VBA code for creation a multi QR codes from selection in excel column
Follow until step 10 then add this code
Sub setQR()

Dim xSRg As Range
Dim xRRg As Range
Dim xObjOLE As OLEObject
On Error Resume Next
Dim srcSelection As Range
Dim srcCell As String
For Each srcSelection In Application.Selection
Dim qrCelltoupdate As String
Dim qrTxt As String
qrCelltoupdate = srcSelection.Offset(0, 1).Address
qrTxt = srcSelection.Text
Worksheets("Sheet1").Range(qrCelltoupdate).Select
Application.ScreenUpdating = False
Set xObjOLE = ActiveSheet.OLEObjects.Add("BARCODE.BarCodeCtrl.1")
xObjOLE.Object.Style = 11
xObjOLE.Object.Value = qrTxt
ActiveSheet.Shapes.Item(xObjOLE.Name).Copy
ActiveSheet.Paste
xObjOLE.Delete
Next srcSelection
'Create Qr code from selection multi cells
End Sub


In step 12 Assign Macro Chose: Sheet1.setQR
QR codes will be populated in next column
Hope that helps for you all
This comment was minimized by the moderator on the site
I didn't have "Microsoft Barcode Control 16.0" so I down loaded per instruction. And open Excel with Admin mode. Then try to "Register Custom" . But I opened Barcode control folder and select MSBCODE964,OCX. Then there is error message came out. It said "The selected file does not contain self-registrating ActiveX control". What it means? What is the problem. And how can I install that?
This comment was minimized by the moderator on the site
1)Click File > Options.

2)Click Trust Center > Trust Center Settings > ActiveX Settings.

Click the options below, and then click OK.
* Enable all controls without restrictions and without prompting (not recommended)
3)Click Ok
There are no comments posted here yet
Load More
Please leave your comments in English
Posting as Guest
×
Rate this post:
0   Characters
Suggested Locations