Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Hello:
I am having a pr blem with the MATCH formula searching a book by a varibale name. I have tried everything I could think of before asking for help. After hours of searching for an answer I'm asking anyone who could solve this puzzle for me. I have two different books, one book I want to match spreadsheet to another spreadsheet in another book, The problem is my variable name is not being regonized workbook_name2 I have two listboxes which I activate, here is a snipet of my code. Dim workbook_name As String Dim workbook_name2 As String Dim Ac As String Dim Bc As String workbook_name = HistoryDialog.Active_Workbook1 workbook_name2 = HistoryDialog.Active_Workbook2 Dim WS1 As Worksheet Dim WS2 As Worksheet Ac = "Currentsheet" Bc = "PreviousSheet" Windows(workbook_name).Activate Windows(workbook_name2).Activate Set WS1 = Workbooks(workbook_name).Worksheets(Ac) Set WS2 = Workbooks(workbook_name2).Worksheets(Bc) WS1.Range("BL2").Resize(n, 1).Formula = "=MATCH(A2,'[workbook_name2]Previoussheet'!A:A,0)" Range("BL2").Select MsgBox ("There is a Match****") 'End If WS2.Range("BL2").Resize(n, 1).Formula = "=MATCH(A2,'[workbook_name]Currentsheet!A:A,0)" Range("BL2").Select Can anyone help mewith this Thnaking you in advance Pam |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Indirect & Match Formula Problem | Excel Discussion (Misc queries) | |||
Variable Work Book Reference | Excel Programming | |||
Formula Problem which includes Sum,If,Frequency,match and row | Excel Discussion (Misc queries) | |||
Array Formula Index Match formulas in VBA problem | Excel Programming | |||
Excel VBA-use variable in active cell formula problem | Excel Programming |