Free Lessons
Courses
Seminars
TechHelp
Fast Tips
Templates
Topic Index
Forum
ABCD
 
Home   Courses   TechHelp   Forums   Help   Contact   Merch   Join   Order   Logon  
 
Back to Visitor Forum    Comments List
Upload Images   @Reply   Bookmark    Link   Email   Next Unseen 
Convert Excel VBA to Access
Qandeel Ayyaz 
   
3 years ago
Is there a way i can apply this excel code in access:
Private Sub Worksheet_Change(ByVal Target As Range)

If Not Intersect(Target, Me.Range("w1")) Is Nothing Then
    
        Call orange
        Application.EnableEvents = True
    End If
End Sub

Module:
Sub orange()
Dim barcode As String
Dim rng As Range
Dim rownumber As Long
If Sheet1.Cells(1, 23) <> "" Then
barcode = Sheet1.Cells(1, 23)

    Set rng = Sheet1.Columns("b:b").Find(What:=barcode, _
    LookIn:=xlFormulas, LookAt:=xlWhole, searchorder:=xlByRows, _
    SearchDirection:=xlNext, MatchCase:=False, SearchFormat:=False)
    
    If rng Is Nothing Then
        MsgBox "Not Found"
        Exit Sub
    Else
        rownumber = rng.Row
        Sheet1.Cells(rownumber, 2).Select
        ActiveCell.Interior.ColorIndex = 45
        Sheet1.Cells(1, 23) = ""
            
    End If
    Sheet1.Cells(1, 23).Select
    
  End If
End Sub
Alex Hedley  @Reply  
           
3 years ago
Can you explain what your code does?
Maybe a screenshot of the outcome.
Do you have the data in Access already?
Richard Rost  @Reply  
           
3 years ago
Can you do something similar in Access? Most likely. Am I going to convert that for you? Absolutely not. LOL.
Kevin Robertson  @Reply  
          
3 years ago
I gave the code a test but without knowing what it's supposed to do all I could get to work was the message box whenever cell 'W1' was changed. Definitely more info needed.
Kevin Yip  @Reply  
     
3 years ago
Hi Qandeel, sounds like you need automation, which is a way to control the Excel application via VBA in Access, and vice versa, with not a lot of changes needed in the code.  This site should have teaching material on automation.
Richard Rost  @Reply  
           
3 years ago
I covered a few bits and pieces of automating Excel from Access in one of the Developer lessons. I've got more coming. It's really cool stuff.

This thread is now CLOSED. If you wish to comment, start a NEW discussion in Visitor Forum.
 

Next Unseen

 
New Feature: Comment Live View
 
 

The following is a paid advertisement
Computer Learning Zone is not responsible for any content shown or offers made by these ads.
 

Learn
 
Access - index
Excel - index
Word - index
Windows - index
PowerPoint - index
Photoshop - index
Visual Basic - index
ASP - index
Seminars
More...
Customers
 
Login
My Account
My Courses
Lost Password
Memberships
Student Databases
Change Email
Info
 
Latest News
New Releases
User Forums
Topic Glossary
Tips & Tricks
Search The Site
Code Vault
Collapse Menus
Help
 
Customer Support
Web Site Tour
FAQs
TechHelp
Consulting Services
About
 
Background
Testimonials
Jobs
Affiliate Program
Richard Rost
Free Lessons
Mailing List
PCResale.NET
Order
 
Video Tutorials
Handbooks
Memberships
Learning Connection
Idiot's Guide to Excel
Volume Discounts
Payment Info
Shipping
Terms of Sale
Contact
 
Contact Info
Support Policy
Mailing Address
Phone Number
Fax Number
Course Survey
Email Richard
[email protected]
Blog RSS Feed    YouTube Channel

LinkedIn
Copyright 2026 by Computer Learning Zone, Amicron, and Richard Rost. All Rights Reserved. Current Time: 6/21/2026 9:32:11 PM. PLT: 0s