Results 1 to 5 of 5

Excel vba coding

Threaded View

Johann Grech Excel vba coding 01-27-2020, 06:16 AM
Sam Capricci Re: Excel vba coding 01-27-2020, 06:44 AM
torachan Re: Excel vba coding 01-27-2020, 07:02 AM
Pepe Le Mokko Re: Excel vba coding 01-27-2020, 07:18 AM
Pepe Le Mokko Re: Excel vba coding 01-27-2020, 07:18 AM
  1. #1
    Registered User
    Join Date
    01-27-2020
    Location
    Malta
    MS-Off Ver
    excel
    Posts
    1

    Excel vba coding

    Hi there I have a problem with vba coding for searching in excel worksheet. My actual code works fine but it searches data from the begining of work sheet rows/cell to the end of work sheet rows/cell. I need to code that it start search from the last row entry to the top of the work sheet. Any help how to modify my code to perform the search from last entry please? this is my actual code:

    Dim totRows As Long, i As Long
    
    totRows = Worksheets("sheet1").Range("A1").CurrentRegion.Rows.Count
    
     If TextBox1.Text = "" Then
       MsgBox "Enter the File Number"
       End If
       
    For i = 2 To totRows
            If Trim(Sheet1.Cells(i, 1) <> Trim(TextBox1.Text)) And i = totRows Then
               MsgBox "File Not Found!"
               End If
    
    thanks
    
               
            If Trim(Sheet1.Cells(i, 1) = Trim(TextBox1.Text)) Then
               TextBox1.Text = Sheet1.Cells(i, 1)
               TextBox2.Text = Sheet1.Cells(i, 2)
               ComboBox1.SelText = Sheet1.Cells(i, 3)
               TextBox3.Text = Sheet1.Cells(i, 4)
               TextBox6.Text = Sheet1.Cells(i, 5)
               ComboBox3.SelText = Sheet1.Cells(i, 6)
               ComboBox2.SelText = Sheet1.Cells(i, 7)
               Exit For
          End If
    Next i
         
        
    End Sub
    Last edited by Pepe Le Mokko; 01-27-2020 at 07:18 AM.

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. [SOLVED] In need of help regarding combo box coding and button coding (Access form project)
    By mailblade in forum Access Tables & Databases
    Replies: 2
    Last Post: 01-09-2016, 01:34 AM
  2. macro coding help (i have no background in coding)
    By notgoodenough in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 08-05-2014, 10:22 PM
  3. [SOLVED] Vb macro coding for transpose - complete coding?
    By Dharani Suresh in forum Excel Programming / VBA / Macros
    Replies: 21
    Last Post: 08-02-2013, 11:16 PM
  4. [SOLVED] Vb macro coding for transpose - complete coding?
    By Dharani Suresh in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 08-02-2013, 05:04 AM
  5. [SOLVED] CheckBox coding to work with ComboBox coding
    By JimExcel in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 02-05-2013, 12:23 PM
  6. Coding and Reverse Coding a Questionnaire
    By lorr3 in forum Excel General
    Replies: 2
    Last Post: 11-18-2012, 06:43 PM
  7. Implant macro coding into ASP coding
    By Sam yong in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 09-15-2005, 06:05 AM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1