Consulting

Results 1 to 1 of 1

Thread: VBA Code to add to the below that will do a vlookup on certain columns that are merge

  1. #1
    VBAX Regular
    Joined
    Aug 2015
    Posts
    13
    Location

    VBA Code to add to the below that will do a vlookup on certain columns that are merge

    I need some help to add a code to vlookup certain columns that are merged cells before or after making the worksheet copies. Thanks

    Sub vbax_53547_CopySpecificSheetNTimes()

    Dim x As Integer, numtimes As Integer

    x = InputBox("Input the number of times to copy MySheet")

    For numtimes = 1 To x
    Sheets("MySheet").Copy After:=Sheets(Sheets.Count)
    Next

    End Sub

    wanting to add this code to do the vlookup but getting errors once they are combined together?

    Dim result As String
    Dim sheet As Worksheet
    Set sheet = ActiveWorkbook.Sheets("Data")
    result = Application.WorksheetFunction.VLookup(sheet.Range("A2"), sheet.Range("B215")
    Last edited by Spooky7; 08-23-2015 at 08:42 AM. Reason: more information

Posting Permissions

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