LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 8
Default VBA Formula Help

The Following is a code I wrote to try and Lookup information from one
workbook and copy and paste that exact information into another workbook. But
I'm having issues with my Formula for Z. I'm trying to use the Match funtion
in excel since it gives you the row number, and my column is going to be
static. Can someone help me out here?

Sub Match()
x = 4
y = 2
b = 14


Dim fName As String
fName = Application.GetOpenFilename()
Workbooks.Open Filename:=fName
Sheets("Accounting_Teams").Select
Sheets("Accounting_Teams").Copy Befo=Workbooks( _
"Tracker-Test.xls").Sheets(1)


Do While Cells(x, y).Value < ""
z = Formula = "=Match(Cells(X,
Y),Sheets(""Accounting_Teams"").Columns(""C:C""),0 )"
Sheets("Accounting_Teams").Select
Cells(z, 20).Select
Selection.Copy
Sheets("Sheet1").Select
Cells(x, b).Select
ActiveSheet.Paste

x = x + 1

Loop

Applications.CutCopyMode = False
Sheets("Accounting_Teams").Select
ActiveWindow.SelectedSheets.Delete

End Sub

 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



All times are GMT +1. The time now is 01:20 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"