How to match data in rows

ma_grado

New Member
Joined
Jun 22, 2011
Messages
3
Below is copy of data I have in a spreadsheet with over 30,000 rows. What can I do to change the BofA in Column 1 to match the number below it in Column 1?

<TABLE style="WIDTH: 188pt; BORDER-COLLAPSE: collapse" border=0 cellSpacing=0 cellPadding=0 width=250><COLGROUP><COL style="WIDTH: 37pt; mso-width-source: userset; mso-width-alt: 1792" width=49><COL style="WIDTH: 37pt; mso-width-source: userset; mso-width-alt: 1792" width=49><COL style="WIDTH: 114pt; mso-width-source: userset; mso-width-alt: 5558" width=152><TBODY><TR style="HEIGHT: 15pt" height=20><TD style="BORDER-BOTTOM: #ffffff; BORDER-LEFT: #ffffff; BACKGROUND-COLOR: transparent; WIDTH: 37pt; HEIGHT: 15pt; BORDER-TOP: #ffffff; BORDER-RIGHT: #ffffff" class=xl65 height=20 width=49>BofA</TD><TD style="BORDER-BOTTOM: #ffffff; BORDER-LEFT: #ffffff; BACKGROUND-COLOR: transparent; WIDTH: 37pt; BORDER-TOP: #ffffff; BORDER-RIGHT: #ffffff" width=49>BofA</TD><TD style="BORDER-BOTTOM: #ffffff; BORDER-LEFT: #ffffff; BACKGROUND-COLOR: transparent; WIDTH: 114pt; BORDER-TOP: #ffffff; BORDER-RIGHT: #ffffff" width=152>LAKENYA</TD></TR><TR style="HEIGHT: 15pt" height=20><TD style="BORDER-BOTTOM: #ffffff; BORDER-LEFT: #ffffff; BACKGROUND-COLOR: transparent; HEIGHT: 15pt; BORDER-TOP: #ffffff; BORDER-RIGHT: #ffffff" class=xl65 height=20>067</TD><TD style="BORDER-BOTTOM: #ffffff; BORDER-LEFT: #ffffff; BACKGROUND-COLOR: transparent; BORDER-TOP: #ffffff; BORDER-RIGHT: #ffffff">067</TD><TD style="BORDER-BOTTOM: #ffffff; BORDER-LEFT: #ffffff; BACKGROUND-COLOR: transparent; BORDER-TOP: #ffffff; BORDER-RIGHT: #ffffff">LAKENYA</TD></TR><TR style="HEIGHT: 15pt" height=20><TD style="BORDER-BOTTOM: #ffffff; BORDER-LEFT: #ffffff; BACKGROUND-COLOR: transparent; HEIGHT: 15pt; BORDER-TOP: #ffffff; BORDER-RIGHT: #ffffff" class=xl65 height=20>BofA</TD><TD style="BORDER-BOTTOM: #ffffff; BORDER-LEFT: #ffffff; BACKGROUND-COLOR: transparent; BORDER-TOP: #ffffff; BORDER-RIGHT: #ffffff">BofA</TD><TD style="BORDER-BOTTOM: #ffffff; BORDER-LEFT: #ffffff; BACKGROUND-COLOR: transparent; BORDER-TOP: #ffffff; BORDER-RIGHT: #ffffff">LANCE</TD></TR><TR style="HEIGHT: 15pt" height=20><TD style="BORDER-BOTTOM: #ffffff; BORDER-LEFT: #ffffff; BACKGROUND-COLOR: transparent; HEIGHT: 15pt; BORDER-TOP: #ffffff; BORDER-RIGHT: #ffffff" class=xl65 height=20>067</TD><TD style="BORDER-BOTTOM: #ffffff; BORDER-LEFT: #ffffff; BACKGROUND-COLOR: transparent; BORDER-TOP: #ffffff; BORDER-RIGHT: #ffffff">029</TD><TD style="BORDER-BOTTOM: #ffffff; BORDER-LEFT: #ffffff; BACKGROUND-COLOR: transparent; BORDER-TOP: #ffffff; BORDER-RIGHT: #ffffff">LANCE</TD></TR><TR style="HEIGHT: 15pt" height=20><TD style="BORDER-BOTTOM: #ffffff; BORDER-LEFT: #ffffff; BACKGROUND-COLOR: transparent; HEIGHT: 15pt; BORDER-TOP: #ffffff; BORDER-RIGHT: #ffffff" class=xl65 height=20>BofA</TD><TD style="BORDER-BOTTOM: #ffffff; BORDER-LEFT: #ffffff; BACKGROUND-COLOR: transparent; BORDER-TOP: #ffffff; BORDER-RIGHT: #ffffff">BofA</TD><TD style="BORDER-BOTTOM: #ffffff; BORDER-LEFT: #ffffff; BACKGROUND-COLOR: transparent; BORDER-TOP: #ffffff; BORDER-RIGHT: #ffffff">MARCELLA</TD></TR><TR style="HEIGHT: 15pt" height=20><TD style="BORDER-BOTTOM: #ffffff; BORDER-LEFT: #ffffff; BACKGROUND-COLOR: transparent; HEIGHT: 15pt; BORDER-TOP: #ffffff; BORDER-RIGHT: #ffffff" class=xl65 height=20>067</TD><TD style="BORDER-BOTTOM: #ffffff; BORDER-LEFT: #ffffff; BACKGROUND-COLOR: transparent; BORDER-TOP: #ffffff; BORDER-RIGHT: #ffffff">067</TD><TD style="BORDER-BOTTOM: #ffffff; BORDER-LEFT: #ffffff; BACKGROUND-COLOR: transparent; BORDER-TOP: #ffffff; BORDER-RIGHT: #ffffff">MARCELLA</TD></TR><TR style="HEIGHT: 15pt" height=20><TD style="BORDER-BOTTOM: #ffffff; BORDER-LEFT: #ffffff; BACKGROUND-COLOR: transparent; HEIGHT: 15pt; BORDER-TOP: #ffffff; BORDER-RIGHT: #ffffff" class=xl65 height=20>BofA</TD><TD style="BORDER-BOTTOM: #ffffff; BORDER-LEFT: #ffffff; BACKGROUND-COLOR: transparent; BORDER-TOP: #ffffff; BORDER-RIGHT: #ffffff">BofA</TD><TD style="BORDER-BOTTOM: #ffffff; BORDER-LEFT: #ffffff; BACKGROUND-COLOR: transparent; BORDER-TOP: #ffffff; BORDER-RIGHT: #ffffff">MATTHEW</TD></TR><TR style="HEIGHT: 15pt" height=20><TD style="BORDER-BOTTOM: #ffffff; BORDER-LEFT: #ffffff; BACKGROUND-COLOR: transparent; HEIGHT: 15pt; BORDER-TOP: #ffffff; BORDER-RIGHT: #ffffff" class=xl65 height=20>067</TD><TD style="BORDER-BOTTOM: #ffffff; BORDER-LEFT: #ffffff; BACKGROUND-COLOR: transparent; BORDER-TOP: #ffffff; BORDER-RIGHT: #ffffff">077</TD><TD style="BORDER-BOTTOM: #ffffff; BORDER-LEFT: #ffffff; BACKGROUND-COLOR: transparent; BORDER-TOP: #ffffff; BORDER-RIGHT: #ffffff">MATTHEW</TD></TR></TBODY></TABLE>
 

Excel Facts

How to create a cell-sized chart?
Tiny charts, called Sparklines, were added to Excel 2010. Look for Sparklines on the Insert tab.
ma_grado,

Welcome to the MrExcel forum.


Sample raw data before the macro:


Excel Workbook
ABC
1BofABofALAKENYA
26767LAKENYA
3BofABofALANCE
46767LANCE
5BofABofAMARCELLA
66767MARCELLA
7BofABofAMATTHEW
86767MATTHEW
9
Sheet1





After the macro:


Excel Workbook
ABC
167BofALAKENYA
26767LAKENYA
367BofALANCE
46767LANCE
567BofAMARCELLA
66767MARCELLA
767BofAMATTHEW
86767MATTHEW
9
Sheet1





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
Option Base 1
Sub UpdateColA()
' hiker95, 06/22/2011
' http://www.mrexcel.com/forum/showthread.php?t=559220
Dim MyA() As Variant, a As Long
Application.ScreenUpdating = False
MyA = Range("A1", Range("A" & Rows.Count).End(xlUp))
For a = LBound(MyA) To UBound(MyA) Step 2
  MyA(a, 1) = MyA(a + 1, 1)
Next a
Range("A1").Resize(UBound(MyA)).Value = MyA
Application.ScreenUpdating = True
End Sub


Then run the UpdateColA macro.
 
Last edited:
Upvote 0
Hi it didnt work. Here is another example of the data. The number changes and in your example it only change to 67.

<TABLE style="WIDTH: 188pt; BORDER-COLLAPSE: collapse" border=0 cellSpacing=0 cellPadding=0 width=250><COLGROUP><COL style="WIDTH: 37pt; mso-width-source: userset; mso-width-alt: 1792" span=2 width=49><COL style="WIDTH: 114pt; mso-width-source: userset; mso-width-alt: 5558" width=152><TBODY><TR style="HEIGHT: 15pt" height=20><TD style="BORDER-BOTTOM: #ffffff; BORDER-LEFT: #ffffff; BACKGROUND-COLOR: transparent; WIDTH: 37pt; HEIGHT: 15pt; BORDER-TOP: #ffffff; BORDER-RIGHT: #ffffff" class=xl65 height=20 width=49></TD><TD style="BORDER-BOTTOM: #ffffff; BORDER-LEFT: #ffffff; BACKGROUND-COLOR: transparent; WIDTH: 37pt; BORDER-TOP: #ffffff; BORDER-RIGHT: #ffffff" class=xl65 width=49>ENTITY</TD><TD style="BORDER-BOTTOM: #ffffff; BORDER-LEFT: #ffffff; BACKGROUND-COLOR: transparent; WIDTH: 114pt; BORDER-TOP: #ffffff; BORDER-RIGHT: #ffffff" class=xl65 width=152>FIRST_NAME</TD></TR><TR style="HEIGHT: 15pt" height=20><TD style="BORDER-BOTTOM: #ffffff; BORDER-LEFT: #ffffff; BACKGROUND-COLOR: transparent; HEIGHT: 15pt; BORDER-TOP: #ffffff; BORDER-RIGHT: #ffffff" height=20>BofA</TD><TD style="BORDER-BOTTOM: #ffffff; BORDER-LEFT: #ffffff; BACKGROUND-COLOR: transparent; BORDER-TOP: #ffffff; BORDER-RIGHT: #ffffff">BofA</TD><TD style="BORDER-BOTTOM: #ffffff; BORDER-LEFT: #ffffff; BACKGROUND-COLOR: transparent; BORDER-TOP: #ffffff; BORDER-RIGHT: #ffffff">Jacquline</TD></TR><TR style="HEIGHT: 15pt" height=20><TD style="BORDER-BOTTOM: #ffffff; BORDER-LEFT: #ffffff; BACKGROUND-COLOR: transparent; HEIGHT: 15pt; BORDER-TOP: #ffffff; BORDER-RIGHT: #ffffff" height=20>001</TD><TD style="BORDER-BOTTOM: #ffffff; BORDER-LEFT: #ffffff; BACKGROUND-COLOR: transparent; BORDER-TOP: #ffffff; BORDER-RIGHT: #ffffff">001</TD><TD style="BORDER-BOTTOM: #ffffff; BORDER-LEFT: #ffffff; BACKGROUND-COLOR: transparent; BORDER-TOP: #ffffff; BORDER-RIGHT: #ffffff">JACQULINE</TD></TR><TR style="HEIGHT: 15pt" height=20><TD style="BORDER-BOTTOM: #ffffff; BORDER-LEFT: #ffffff; BACKGROUND-COLOR: transparent; HEIGHT: 15pt; BORDER-TOP: #ffffff; BORDER-RIGHT: #ffffff" height=20>BofA</TD><TD style="BORDER-BOTTOM: #ffffff; BORDER-LEFT: #ffffff; BACKGROUND-COLOR: transparent; BORDER-TOP: #ffffff; BORDER-RIGHT: #ffffff">BofA</TD><TD style="BORDER-BOTTOM: #ffffff; BORDER-LEFT: #ffffff; BACKGROUND-COLOR: transparent; BORDER-TOP: #ffffff; BORDER-RIGHT: #ffffff">JOETTE</TD></TR><TR style="HEIGHT: 15pt" height=20><TD style="BORDER-BOTTOM: #ffffff; BORDER-LEFT: #ffffff; BACKGROUND-COLOR: transparent; HEIGHT: 15pt; BORDER-TOP: #ffffff; BORDER-RIGHT: #ffffff" height=20>001</TD><TD style="BORDER-BOTTOM: #ffffff; BORDER-LEFT: #ffffff; BACKGROUND-COLOR: transparent; BORDER-TOP: #ffffff; BORDER-RIGHT: #ffffff">001</TD><TD style="BORDER-BOTTOM: #ffffff; BORDER-LEFT: #ffffff; BACKGROUND-COLOR: transparent; BORDER-TOP: #ffffff; BORDER-RIGHT: #ffffff">JOETTE</TD></TR><TR style="HEIGHT: 15pt" height=20><TD style="BORDER-BOTTOM: #ffffff; BORDER-LEFT: #ffffff; BACKGROUND-COLOR: transparent; HEIGHT: 15pt; BORDER-TOP: #ffffff; BORDER-RIGHT: #ffffff" height=20>BofA</TD><TD style="BORDER-BOTTOM: #ffffff; BORDER-LEFT: #ffffff; BACKGROUND-COLOR: transparent; BORDER-TOP: #ffffff; BORDER-RIGHT: #ffffff">BofA</TD><TD style="BORDER-BOTTOM: #ffffff; BORDER-LEFT: #ffffff; BACKGROUND-COLOR: transparent; BORDER-TOP: #ffffff; BORDER-RIGHT: #ffffff">ELAINE</TD></TR><TR style="HEIGHT: 15pt" height=20><TD style="BORDER-BOTTOM: #ffffff; BORDER-LEFT: #ffffff; BACKGROUND-COLOR: transparent; HEIGHT: 15pt; BORDER-TOP: #ffffff; BORDER-RIGHT: #ffffff" height=20>013</TD><TD style="BORDER-BOTTOM: #ffffff; BORDER-LEFT: #ffffff; BACKGROUND-COLOR: transparent; BORDER-TOP: #ffffff; BORDER-RIGHT: #ffffff">013</TD><TD style="BORDER-BOTTOM: #ffffff; BORDER-LEFT: #ffffff; BACKGROUND-COLOR: transparent; BORDER-TOP: #ffffff; BORDER-RIGHT: #ffffff">ELAINE</TD></TR><TR style="HEIGHT: 15pt" height=20><TD style="BORDER-BOTTOM: #ffffff; BORDER-LEFT: #ffffff; BACKGROUND-COLOR: transparent; HEIGHT: 15pt; BORDER-TOP: #ffffff; BORDER-RIGHT: #ffffff" height=20>BofA</TD><TD style="BORDER-BOTTOM: #ffffff; BORDER-LEFT: #ffffff; BACKGROUND-COLOR: transparent; BORDER-TOP: #ffffff; BORDER-RIGHT: #ffffff">BofA</TD><TD style="BORDER-BOTTOM: #ffffff; BORDER-LEFT: #ffffff; BACKGROUND-COLOR: transparent; BORDER-TOP: #ffffff; BORDER-RIGHT: #ffffff">MARION</TD></TR><TR style="HEIGHT: 15pt" height=20><TD style="BORDER-BOTTOM: #ffffff; BORDER-LEFT: #ffffff; BACKGROUND-COLOR: transparent; HEIGHT: 15pt; BORDER-TOP: #ffffff; BORDER-RIGHT: #ffffff" height=20>013</TD><TD style="BORDER-BOTTOM: #ffffff; BORDER-LEFT: #ffffff; BACKGROUND-COLOR: transparent; BORDER-TOP: #ffffff; BORDER-RIGHT: #ffffff">013</TD><TD style="BORDER-BOTTOM: #ffffff; BORDER-LEFT: #ffffff; BACKGROUND-COLOR: transparent; BORDER-TOP: #ffffff; BORDER-RIGHT: #ffffff">MARION</TD></TR><TR style="HEIGHT: 15pt" height=20><TD style="BORDER-BOTTOM: #ffffff; BORDER-LEFT: #ffffff; BACKGROUND-COLOR: transparent; HEIGHT: 15pt; BORDER-TOP: #ffffff; BORDER-RIGHT: #ffffff" height=20>BofA</TD><TD style="BORDER-BOTTOM: #ffffff; BORDER-LEFT: #ffffff; BACKGROUND-COLOR: transparent; BORDER-TOP: #ffffff; BORDER-RIGHT: #ffffff">BofA</TD><TD style="BORDER-BOTTOM: #ffffff; BORDER-LEFT: #ffffff; BACKGROUND-COLOR: transparent; BORDER-TOP: #ffffff; BORDER-RIGHT: #ffffff">PASSEFUN</TD></TR><TR style="HEIGHT: 15pt" height=20><TD style="BORDER-BOTTOM: #ffffff; BORDER-LEFT: #ffffff; BACKGROUND-COLOR: transparent; HEIGHT: 15pt; BORDER-TOP: #ffffff; BORDER-RIGHT: #ffffff" height=20>013</TD><TD style="BORDER-BOTTOM: #ffffff; BORDER-LEFT: #ffffff; BACKGROUND-COLOR: transparent; BORDER-TOP: #ffffff; BORDER-RIGHT: #ffffff">013</TD><TD style="BORDER-BOTTOM: #ffffff; BORDER-LEFT: #ffffff; BACKGROUND-COLOR: transparent; BORDER-TOP: #ffffff; BORDER-RIGHT: #ffffff">PASSEFUN</TD></TR><TR style="HEIGHT: 15pt" height=20><TD style="BORDER-BOTTOM: #ffffff; BORDER-LEFT: #ffffff; BACKGROUND-COLOR: transparent; HEIGHT: 15pt; BORDER-TOP: #ffffff; BORDER-RIGHT: #ffffff" height=20>BofA</TD><TD style="BORDER-BOTTOM: #ffffff; BORDER-LEFT: #ffffff; BACKGROUND-COLOR: transparent; BORDER-TOP: #ffffff; BORDER-RIGHT: #ffffff">BofA</TD><TD style="BORDER-BOTTOM: #ffffff; BORDER-LEFT: #ffffff; BACKGROUND-COLOR: transparent; BORDER-TOP: #ffffff; BORDER-RIGHT: #ffffff">JOY</TD></TR><TR style="HEIGHT: 15pt" height=20><TD style="BORDER-BOTTOM: #ffffff; BORDER-LEFT: #ffffff; BACKGROUND-COLOR: transparent; HEIGHT: 15pt; BORDER-TOP: #ffffff; BORDER-RIGHT: #ffffff" height=20>017</TD><TD style="BORDER-BOTTOM: #ffffff; BORDER-LEFT: #ffffff; BACKGROUND-COLOR: transparent; BORDER-TOP: #ffffff; BORDER-RIGHT: #ffffff">017</TD><TD style="BORDER-BOTTOM: #ffffff; BORDER-LEFT: #ffffff; BACKGROUND-COLOR: transparent; BORDER-TOP: #ffffff; BORDER-RIGHT: #ffffff">JOY</TD></TR><TR style="HEIGHT: 15pt" height=20><TD style="BORDER-BOTTOM: #ffffff; BORDER-LEFT: #ffffff; BACKGROUND-COLOR: transparent; HEIGHT: 15pt; BORDER-TOP: #ffffff; BORDER-RIGHT: #ffffff" height=20>BofA</TD><TD style="BORDER-BOTTOM: #ffffff; BORDER-LEFT: #ffffff; BACKGROUND-COLOR: transparent; BORDER-TOP: #ffffff; BORDER-RIGHT: #ffffff">BofA</TD><TD style="BORDER-BOTTOM: #ffffff; BORDER-LEFT: #ffffff; BACKGROUND-COLOR: transparent; BORDER-TOP: #ffffff; BORDER-RIGHT: #ffffff">JEFFREY</TD></TR><TR style="HEIGHT: 15pt" height=20><TD style="BORDER-BOTTOM: #ffffff; BORDER-LEFT: #ffffff; BACKGROUND-COLOR: transparent; HEIGHT: 15pt; BORDER-TOP: #ffffff; BORDER-RIGHT: #ffffff" height=20>017</TD><TD style="BORDER-BOTTOM: #ffffff; BORDER-LEFT: #ffffff; BACKGROUND-COLOR: transparent; BORDER-TOP: #ffffff; BORDER-RIGHT: #ffffff">017</TD><TD style="BORDER-BOTTOM: #ffffff; BORDER-LEFT: #ffffff; BACKGROUND-COLOR: transparent; BORDER-TOP: #ffffff; BORDER-RIGHT: #ffffff">JEFFREY</TD></TR></TBODY></TABLE>
 
Upvote 0
try this formula in column 1 and copy it down

=IF(INDIRECT("A"&ROW())="BofA",INDIRECT("A"&ROW()+1),INDIRECT("A"&ROW()))
 
Upvote 0
do you have any formula or reference in that column?

It is working in the sample data provided by you as follows

1 BofA Jacquline
1 1 JACQULINE
1 BofA JOETTE
1 1 JOETTE
13 BofA ELAINE
13 13 ELAINE
13 BofA MARION
13 13 MARION
13 BofA PASSEFUN
13 13 PASSEFUN
17 BofA JOY
17 17 JOY
17 BofA JEFFREY
17 17 JEFFREY
 
Upvote 0
ma_grado,


Sample raw data before the macro:


Excel Workbook
ABC
1ENTITYFIRST_NAME
2BofABofAJacquline
3001001JACQULINE
4BofABofAJOETTE
5001001JOETTE
6BofABofAELAINE
7013013ELAINE
8BofABofAMARION
9013013MARION
10BofABofAPASSEFUN
11013013PASSEFUN
12BofABofAJOY
13017017JOY
14BofABofAJEFFREY
15017017JEFFREY
16
Sheet1





After the updated macro:


Excel Workbook
ABC
1ENTITYFIRST_NAME
2001BofAJacquline
3001001JACQULINE
4001BofAJOETTE
5001001JOETTE
6013BofAELAINE
7013013ELAINE
8013BofAMARION
9013013MARION
10013BofAPASSEFUN
11013013PASSEFUN
12017BofAJOY
13017017JOY
14017BofAJEFFREY
15017017JEFFREY
16
Sheet1





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
Option Base 1
Sub UpdateColA_V2()
' hiker95, 06/23/2011
' http://www.mrexcel.com/forum/showthread.php?t=559220
Dim MyA() As Variant, a As Long
Application.ScreenUpdating = False
MyA = Range("A2", Range("A" & Rows.Count).End(xlUp))
For a = LBound(MyA) To UBound(MyA) Step 2
  MyA(a, 1) = MyA(a + 1, 1)
Next a
Range("A2").Resize(UBound(MyA)).Value = MyA
Application.ScreenUpdating = True
End Sub


Then run the UpdateColA_V2 macro.



If the above macro does not work correctly, then:

What version of Excel are you using?

You will generally get much more help (and faster) in this forum if you can post your small samples (what you have and what you expect to achieve) directly in the forum.

To attach screenshots, see below in my Signature block: Post a screen shot with one of these:

If you are not able to give us screenshots, see below in my Signature block: You can upload your workbook to Box Net
 
Upvote 0
Another way

Before macro

<b>Excel 2010</b><table cellpadding="2.5px" rules="all" style=";background-color: #FFFFFF;border: 1px solid;border-collapse: collapse; border-color: #BBB"><colgroup><col width="10px" style="background-color: #DAE7F5" /><col /><col /><col /></colgroup><thead><tr style=" background-color: #DAE7F5;text-align: center;color: #161120"><th></th><th>A</th><th>B</th><th>C</th></tr></thead><tbody><tr ><td style="color: #161120;text-align: center;">1</td><td style=";"> </td><td style=";">ENTITY</td><td style=";">FIRST_NAME</td></tr><tr ><td style="color: #161120;text-align: center;">2</td><td style=";">BofA</td><td style=";">BofA</td><td style=";">Jacquline</td></tr><tr ><td style="color: #161120;text-align: center;">3</td><td style="text-align: right;;">1</td><td style="text-align: right;;">1</td><td style=";">JACQULINE</td></tr><tr ><td style="color: #161120;text-align: center;">4</td><td style=";">BofA</td><td style=";">BofA</td><td style=";">JOETTE</td></tr><tr ><td style="color: #161120;text-align: center;">5</td><td style="text-align: right;;">1</td><td style="text-align: right;;">1</td><td style=";">JOETTE</td></tr><tr ><td style="color: #161120;text-align: center;">6</td><td style=";">BofA</td><td style=";">BofA</td><td style=";">ELAINE</td></tr><tr ><td style="color: #161120;text-align: center;">7</td><td style="text-align: right;;">13</td><td style="text-align: right;;">13</td><td style=";">ELAINE</td></tr><tr ><td style="color: #161120;text-align: center;">8</td><td style=";">BofA</td><td style=";">BofA</td><td style=";">MARION</td></tr><tr ><td style="color: #161120;text-align: center;">9</td><td style="text-align: right;;">13</td><td style="text-align: right;;">13</td><td style=";">MARION</td></tr><tr ><td style="color: #161120;text-align: center;">10</td><td style=";">BofA</td><td style=";">BofA</td><td style=";">PASSEFUN</td></tr><tr ><td style="color: #161120;text-align: center;">11</td><td style="text-align: right;;">13</td><td style="text-align: right;;">13</td><td style=";">PASSEFUN</td></tr><tr ><td style="color: #161120;text-align: center;">12</td><td style=";">BofA</td><td style=";">BofA</td><td style=";">JOY</td></tr><tr ><td style="color: #161120;text-align: center;">13</td><td style="text-align: right;;">17</td><td style="text-align: right;;">17</td><td style=";">JOY</td></tr><tr ><td style="color: #161120;text-align: center;">14</td><td style=";">BofA</td><td style=";">BofA</td><td style=";">JEFFREY</td></tr><tr ><td style="color: #161120;text-align: center;">15</td><td style="text-align: right;;">17</td><td style="text-align: right;;">17</td><td style=";">JEFFREY</td></tr></tbody></table><p style="width:3.6em;font-weight:bold;margin:0;padding:0.2em 0.6em 0.2em 0.5em;border: 1px solid #BBB;border-top:none;text-align: center;background-color: #DAE7F5;color: #161120">Sheet1</p><br /><br />

After macro

<b>Excel 2010</b><table cellpadding="2.5px" rules="all" style=";background-color: #FFFFFF;border: 1px solid;border-collapse: collapse; border-color: #BBB"><colgroup><col width="10px" style="background-color: #DAE7F5" /><col /><col /><col /></colgroup><thead><tr style=" background-color: #DAE7F5;text-align: center;color: #161120"><th></th><th>A</th><th>B</th><th>C</th></tr></thead><tbody><tr ><td style="color: #161120;text-align: center;">1</td><td style=";"> </td><td style=";">ENTITY</td><td style=";">FIRST_NAME</td></tr><tr ><td style="color: #161120;text-align: center;">2</td><td style="text-align: right;;">1</td><td style=";">BofA</td><td style=";">Jacquline</td></tr><tr ><td style="color: #161120;text-align: center;">3</td><td style="text-align: right;;">1</td><td style="text-align: right;;">1</td><td style=";">JACQULINE</td></tr><tr ><td style="color: #161120;text-align: center;">4</td><td style="text-align: right;;">1</td><td style=";">BofA</td><td style=";">JOETTE</td></tr><tr ><td style="color: #161120;text-align: center;">5</td><td style="text-align: right;;">1</td><td style="text-align: right;;">1</td><td style=";">JOETTE</td></tr><tr ><td style="color: #161120;text-align: center;">6</td><td style="text-align: right;;">13</td><td style=";">BofA</td><td style=";">ELAINE</td></tr><tr ><td style="color: #161120;text-align: center;">7</td><td style="text-align: right;;">13</td><td style="text-align: right;;">13</td><td style=";">ELAINE</td></tr><tr ><td style="color: #161120;text-align: center;">8</td><td style="text-align: right;;">13</td><td style=";">BofA</td><td style=";">MARION</td></tr><tr ><td style="color: #161120;text-align: center;">9</td><td style="text-align: right;;">13</td><td style="text-align: right;;">13</td><td style=";">MARION</td></tr><tr ><td style="color: #161120;text-align: center;">10</td><td style="text-align: right;;">13</td><td style=";">BofA</td><td style=";">PASSEFUN</td></tr><tr ><td style="color: #161120;text-align: center;">11</td><td style="text-align: right;;">13</td><td style="text-align: right;;">13</td><td style=";">PASSEFUN</td></tr><tr ><td style="color: #161120;text-align: center;">12</td><td style="text-align: right;;">17</td><td style=";">BofA</td><td style=";">JOY</td></tr><tr ><td style="color: #161120;text-align: center;">13</td><td style="text-align: right;;">17</td><td style="text-align: right;;">17</td><td style=";">JOY</td></tr><tr ><td style="color: #161120;text-align: center;">14</td><td style="text-align: right;;">17</td><td style=";">BofA</td><td style=";">JEFFREY</td></tr><tr ><td style="color: #161120;text-align: center;">15</td><td style="text-align: right;;">17</td><td style="text-align: right;;">17</td><td style=";">JEFFREY</td></tr></tbody></table><p style="width:3.6em;font-weight:bold;margin:0;padding:0.2em 0.6em 0.2em 0.5em;border: 1px solid #BBB;border-top:none;text-align: center;background-color: #DAE7F5;color: #161120">Sheet1</p><br /><br />

Code:
Sub Test()
    With Range("A2", Range("A" & Rows.Count).End(xlUp))
        .Formula = "=IF(ISNUMBER(B2),B2,B3)"
        .Value = .Value
    End With
End Sub
 
Upvote 0

Forum statistics

Threads
1,224,548
Messages
6,179,448
Members
452,915
Latest member
hannnahheileen

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top