+ Reply to Thread
Results 1 to 4 of 4

Read data from excel to userform

Hybrid View

  1. #1
    Forum Contributor
    Join Date
    03-06-2014
    Location
    malaysia
    MS-Off Ver
    Excel 2003/2010/2013
    Posts
    107

    Read data from excel to userform

    Hey guys,

    Tried code below to read my data from excel to userform . Found this code from youtube and try do modification but not working.

    Any one can help?

    Private Sub CommandButton1_Click()
    Dim ISBNColumn As Integer
    Dim TitleColumn As Long
    
    ISBNColumn = 2
    TitleColumn = 1
    
    Dim ISBNno As String
    Dim Titleno As String
    
    Dim readdata As Range
    Set readdata = ThisWorkbook.Sheets("Sheet1")
    
    rowCounter = 0
    
    Do
    DoEvents
    rowCounter = rowCounter + 1
    'readdata = Sheets("Sheet1").Cells(rowCounter, ISBNColumn).Value
    readdata.Range (ISBNColumn & rowCounter)
        
        If readdata = ISBNTextBox.Text Then
        EPRNTextBox.Text = Sheets("Sheet1").Range(TitleColumn & rowCounter)
        End If
        
    Loop Until readdata = ""
    
    End Sub
    http://www.excelforum.com/attachment...1&d=1468923106
    Attached Files Attached Files

  2. #2
    Forum Contributor
    Join Date
    04-29-2012
    Location
    nuneaton, England
    MS-Off Ver
    Office 365
    Posts
    371

    Re: Read data from excel to userform

    im lost at what you are trying to do, what are you searching for... the title, then it gives you the number?

    what i have done if that is the case is

    Range("L5") = TextBox1
    nameofUserForm.TextBox2 = Range("L6").Text

    L6 contains a vlookup or indexmatch using the contents of L5 as the subject of the search
    Last edited by wayneg; 07-19-2016 at 07:14 AM.

  3. #3
    Forum Contributor
    Join Date
    03-06-2014
    Location
    malaysia
    MS-Off Ver
    Excel 2003/2010/2013
    Posts
    107
    Quote Originally Posted by wayneg View Post
    im lost at what you are trying to do, what are you searching for... the title, then it gives you the number?

    what i have done if that is the case is

    Range("L5") = TextBox1
    nameofUserForm.TextBox2 = Range("L6").Text

    L6 contains a vlookup or indexmatch using the contents of L5 as the subject of the search
    I have alot of set data. What i want to do is like "Find" in excel. But using userform instead.

    For example: when B2 value entered, then press Search, results will be A2 cell value in the userform.

    Sorry about less details in first post.

  4. #4
    Forum Contributor
    Join Date
    03-06-2014
    Location
    malaysia
    MS-Off Ver
    Excel 2003/2010/2013
    Posts
    107

    Re: Read data from excel to userform

    Its something like this, i tried to replicate the code but not working.

    https://youtu.be/QU9g7N_PgIA

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. [SOLVED] How to read text data from .dat files and fetch the data in to excel based on input..
    By mahendra.asapu in forum Excel Programming / VBA / Macros
    Replies: 62
    Last Post: 07-19-2015, 04:36 AM
  2. Open workbook in read only or read write for excel 2010 version
    By Agent1 in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 12-20-2014, 07:19 PM
  3. More users in 1 Excel file , VBA userform. read only solution?
    By stevnb in forum Excel Programming / VBA / Macros
    Replies: 8
    Last Post: 11-27-2012, 10:11 AM
  4. Read Data into an Array, Write Data into Another Sheet (Excel VBA Only) [v14/2010]
    By lloydgodin in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 06-15-2012, 07:22 PM
  5. Help with userform (trying to read data from table into combo list)
    By EK1 in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 03-05-2010, 10:18 AM
  6. Read Worksheet Data into Userform
    By msommerf in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 09-10-2009, 10:12 AM
  7. Excel Macro - Read excel & read excel range - save as text
    By se.sathish in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 01-21-2008, 09:00 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