ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Discussion (Misc queries) (https://www.excelbanter.com/excel-discussion-misc-queries/)
-   -   excel macro needed - find and move data (https://www.excelbanter.com/excel-discussion-misc-queries/250501-excel-macro-needed-find-move-data.html)

The Kid

excel macro needed - find and move data
 
I want a Marco that will search for numbers ending in CR see below and then
shift the amounts ending with CR from col J to Col K.

Thanking you in advacne for your assistance



J K

1,619.53
2,195.00
242,483.15
302.61
721,171.17CR
425,093.66CR
39,354.94
180.00CR
5,201.34CR
834.60CR
16,968.80
17,577.92
44,204.32

FSt1

excel macro needed - find and move data
 
hi
something like this.....
Sub moveit()
Dim r As Range
Dim lr As Long

lr = Cells(Rows.Count, "J").End(xlUp).Row
Set r = Range("J2:J" & lr)

For Each cell In r
If Right(cell, 2) = "CR" Then
cell.Offset(0, 1) = cell.Value
cell.ClearContents
End If
Next cell

End Sub

regards
FSt1

"The Kid" wrote:

I want a Marco that will search for numbers ending in CR see below and then
shift the amounts ending with CR from col J to Col K.

Thanking you in advacne for your assistance



J K

1,619.53
2,195.00
242,483.15
302.61
721,171.17CR
425,093.66CR
39,354.94
180.00CR
5,201.34CR
834.60CR
16,968.80
17,577.92
44,204.32



All times are GMT +1. The time now is 03:04 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com