VBA code help

Status
Not open for further replies.

dominko

New Member
Joined
Jul 13, 2023
Messages
7
Office Version
  1. 2016
Platform
  1. Windows
hello,

I have a problem with scanning QR codes, tried everything but everytime I scan with a 2D barcode scanner it scans the whole number from QR code, all I need is the last 4 numbers from it. The serial number.

i have this code that works in excel but in LibreOffice CALC

Private Sub Worksheet_Change(ByVal Target As Range)

' Exit if more than one cell updated at once
If Target.CountLarge > 1 Then Exit Sub

' Only run only column C, on row 2 or below
If Target.Column = 3 And Target.Row >= 2 Then
' Trim entry to last four characters
If Len(Target) > 4 Then
Application.EnableEvents = False
Target = Right(Target, 4)
Application.EnableEvents = True
End If
End If

End Sub

I just need to convert this VBA code to API code if anyone know how I would I appreciate it. thanks a lot
 

Excel Facts

What did Pito Salas invent?
Pito Salas, working for Lotus, popularized what would become to be pivot tables. It was released as Lotus Improv in 1989.
This is a duplicate thread. Please do not post the same question more than once. Thread closed.
 
Upvote 0
Status
Not open for further replies.

Forum statistics

Threads
1,215,133
Messages
6,123,234
Members
449,092
Latest member
SCleaveland

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