Results 1 to 4 of 4

Facing problem with debuging vba code for vlookup

Threaded View

amber_skanpur Facing problem with debuging... 04-02-2014, 10:59 PM
jewelsharma Re: Facing problem with... 04-02-2014, 11:32 PM
wcymiss Re: Facing problem with... 04-03-2014, 01:18 AM
amber_skanpur Re: Facing problem with... 04-03-2014, 08:52 AM
  1. #1
    Registered User
    Join Date
    03-30-2014
    Location
    India
    MS-Off Ver
    Excel 2007
    Posts
    21

    Facing problem with debuging vba code for vlookup

    Hi Folks,

    I was trying to execute a code for vlookup.

    It isn't working though

    Can you help me with a solution?

    Pls refer attachment for getting further clarity.

    The code is placed below for your reference.
    -------------------------------------------------------------------------------------------------------------------------------------------------------
    Sub vlookup4()


    Dim myfilename As Variant
    Dim mysheetname As Variant
    Dim myrangename As String
    Dim c As String

    Workbooks("Book10.xlsm").Sheets("sheet1").Activate
    myfilename = ActiveWorkbook.Name
    mysheetname = ActiveSheet.Name
    Worksheets("sheet1").Range("b2:E930").Select
    myrangename = Selection.Address

    c = Worksheets("sheet4").Range("b2").Value
    Workbooks("Book10.xlsm").Sheets("sheet4").Activate

    Range("g2").Formula = "=vlookup(" & c & ",[" & myfilename & "]" & mysheetname & "!" & myrangename & ",4,0)"
    Range("g2") = Range("g2")
    End Sub
    ---------------------------------------------------------------------------------------------------------------------
    Thanks in advance
    Attached Files Attached Files

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. i am facing problem with range object
    By saanket in forum Excel General
    Replies: 1
    Last Post: 12-27-2011, 04:25 AM
  2. VBA Program problem facing
    By Anshuman in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 09-16-2009, 01:21 PM
  3. Mysterious problem facing with function
    By sumonrezadu in forum Excel General
    Replies: 1
    Last Post: 08-27-2009, 11:22 PM
  4. Pivot: Facing Problem in Worksheet
    By mangchik in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 07-03-2006, 10:33 AM
  5. facing formula problem
    By thinkpic in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 11-02-2005, 06:17 PM

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