Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
I have a macro that works when matching both row and column values to paste a
value in a cell. Now, I need to paste about 10 values into the same columns, but into the row that has the right value. Example: I want to paste the same 10 values from one workbook into a row in another workbook that has the exact same Franchise number in Column A as the Franchise number from the first worksheet (the numbers are in Column A, begin on row 3 and start with 1 and go down to 200. Rows 1 & 2 have titles). The code I'm usings seems like it's working, but nothing is happening on my test of the first datapoint. Can someone help? Here's the code I'm using... Sub January() Dim iOffice As Integer, iValue wbData.Activate 'Data comes from here With wbData.Sheets("Global & Monthly Inputs") iOffice = .Range("B6") iValueFN = .Range("B5") 'End With ' apply iValueFN - Variance to matched row wbTarget.Activate 'Data goes to here With wbTarget.Sheets("Monthly Data") Dim lastrow As Long, lastcol As Long, xV As Long, xR As Long, xC As Long lastrow = .Cells(Rows.Count, 1).End(xlUp).Row 'get matching row For xV = 1 To lastrow If iOffice = .Cells(xV, 1) Then xR = xV Next xV If xR = 0 Then MsgBox "Office: " & iOffice & " not found in summary Table" If xR 0 Then .Cells(xR, 2) = iValueFN 'Column 2 (B) will always be used for this value End With 'Is not working to copy to specific row!! End Sub THanks!! |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Copy / paste only specific rows | Excel Discussion (Misc queries) | |||
Find matching date in another worksheet, copy and paste data | Excel Discussion (Misc queries) | |||
COPY AND PASTE SPECIFIC ROWS | Excel Discussion (Misc queries) | |||
Copy and Paste specific data | Excel Programming | |||
copy and paste matching by using ID's | Excel Programming |