dwood,
Sample worksheets:
Sheet1
* | A | B |
account number | demographic | |
demographic for 12345 | | |
demographic for 12554 | | |
demographic for 12555 | | |
* | * | |
<COLGROUP><COL style="WIDTH: 30px; FONT-WEIGHT: bold"><COL style="WIDTH: 127px"><COL style="WIDTH: 209px"></COLGROUP><TBODY>
[TD="bgcolor: #cacaca, align: center"]1[/TD]
[TD="bgcolor: #cacaca, align: center"]2[/TD]
[TD="align: right"]12345[/TD]
[TD="bgcolor: #cacaca, align: center"]3[/TD]
[TD="align: right"]12554[/TD]
[TD="bgcolor: #cacaca, align: center"]4[/TD]
[TD="align: right"]12555[/TD]
[TD="bgcolor: #cacaca, align: center"]5[/TD]
</TBODY>
Excel tables to the web >> Excel Jeanie HTML 4
Sheet2
* | A | B |
account number | demographic | |
* | | |
* | | |
* | | |
* | | |
* | * | |
<COLGROUP><COL style="WIDTH: 30px; FONT-WEIGHT: bold"><COL style="WIDTH: 127px"><COL style="WIDTH: 209px"></COLGROUP><TBODY>
[TD="bgcolor: #cacaca, align: center"]1[/TD]
[TD="bgcolor: #cacaca, align: center"]2[/TD]
[TD="align: right"]12121[/TD]
[TD="bgcolor: #cacaca, align: center"]3[/TD]
[TD="align: right"]12345[/TD]
[TD="bgcolor: #cacaca, align: center"]4[/TD]
[TD="align: right"]12350[/TD]
[TD="bgcolor: #cacaca, align: center"]5[/TD]
[TD="align: right"]12555[/TD]
[TD="bgcolor: #cacaca, align: center"]6[/TD]
</TBODY>
Excel tables to the web >> Excel Jeanie HTML 4
After the macro:
Sheet2
* | A | B |
account number | demographic | |
* | | |
demographic for 12345 | | |
* | | |
demographic for 12555 | | |
* | * | |
<COLGROUP><COL style="WIDTH: 30px; FONT-WEIGHT: bold"><COL style="WIDTH: 127px"><COL style="WIDTH: 209px"></COLGROUP><TBODY>
[TD="bgcolor: #cacaca, align: center"]1[/TD]
[TD="bgcolor: #cacaca, align: center"]2[/TD]
[TD="align: right"]12121[/TD]
[TD="bgcolor: #cacaca, align: center"]3[/TD]
[TD="align: right"]12345[/TD]
[TD="bgcolor: #cacaca, align: center"]4[/TD]
[TD="align: right"]12350[/TD]
[TD="bgcolor: #cacaca, align: center"]5[/TD]
[TD="align: right"]12555[/TD]
[TD="bgcolor: #cacaca, align: center"]6[/TD]
</TBODY>
Excel tables to the web >> Excel Jeanie HTML 4
Please TEST this FIRST in a COPY of your workbook (always make a backup copy before trying new code, you never know what you might lose).
1. Copy the below code, by highlighting the code and pressing the keys
CTRL +
C
2. Open your workbook
3. Press the keys
ALT +
F11 to open the Visual Basic Editor
4. Press the keys
ALT +
I to activate the Insert menu
5. Press
M to insert a Standard Module
6. Where the cursor is flashing, paste the code by pressing the keys
CTRL +
V
7. Press the keys
ALT +
Q to exit the Editor, and return to Excel
8. To run the macro from Excel, open the workbook, and press
ALT +
F8 to display the Run Macro Dialog. Double Click the macro's name to Run it.
Code:
Option Explicit
Sub UpdateW2()
' hiker95, 06/16/2011
' http://www.mrexcel.com/forum/showthread.php?t=557784
Dim w1 As Worksheet, w2 As Worksheet
Dim c As Range, FR As Long
Application.ScreenUpdating = False
Set w1 = Worksheets("Sheet1")
Set w2 = Worksheets("Sheet2")
For Each c In w1.Range("A2", w1.Range("A" & Rows.Count).End(xlUp))
FR = 0
On Error Resume Next
FR = Application.Match(c, w2.Columns(1), 0)
On Error GoTo 0
If FR <> 0 Then w2.Range("B" & FR).Value = c.Offset(, 1)
Next c
Application.ScreenUpdating = True
End Sub
Then run the UpdateW2 macro.
If the above macro does not work correctly, then we will need screenshots of the two worksheets:
To attach screenshots, see below in my Signature block:
Post a screen shot with one of these:[/QUOTE I used this Macro in a similar situation, however my account number will duplicate in the 2nd worksheet and I need for the macro to update each account number in the second worksheet that it matches even if it is a duplicate, could you advise how to revise the macro for that?]