coping data based on specific Crieria

howard

Well-known Member
Joined
Jun 26, 2006
Messages
6,595
Office Version
  1. 2021
Platform
  1. Windows
I have descriptions in Col I.


where a/c 95915, 95925, 95950 are in Col G, I want the descriptions that are in the same row in Col I copied to Col H only for these account numbers



Book1
GHI
195915TaxSales
295915TaxSales
395915TaxSales
495925TaxPurchases
595925TaxPurchases
695950Taxadmin
795950TaxAdmin
Sheet1



This is what it should look like after running Macro



Book1
GHI
195915SalesSales
295915SalesSales
395915SalesSales
495925PurchasesPurchases
595925PurchasesPurchases
695950adminadmin
795950AdminAdmin
8
Sheet1



Your assistance is most appreciated
 

Excel Facts

Round to nearest half hour?
Use =MROUND(A2,"0:30") to round to nearest half hour. Use =CEILING(A2,"0:30") to round to next half hour.
This works

Code:
Sub k1()
lastrow = Worksheets("Sheet1").Cells(Rows.Count, "G").End(xlUp).Row
For i = 1 To lastrow
If Cells(i, 7) = 95915 Or Cells(i, 7) = 95925 Or Cells(i, 7) = 95950 Then
    Cells(i, 8) = Cells(i, 9)
End If
Next i
End Sub
 
Upvote 0

Forum statistics

Threads
1,223,898
Messages
6,175,272
Members
452,628
Latest member
dd2

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