Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
I have imported data into excel of which the content are accounting journal
entries. As the comment relating to the journal ends up in column D above the journal numbers (also in column D) I need a macro that will find all of the comments that will all contain a common word such as "To" and cut and paste them into column C so that I will be able to sort the data or use pivot tables to identify duplicate entries. Any ideas appreciated! |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]() Dim i For i = 1 To Cells(Rows.Count, "D").End(xlUp).Row If LCase(Cells(i, "D").Value) Like "*to*" Then Cells(i, "C").Value = Cells(i, "D").Value End If Next be aware thoughthat this will also find such as together. -- HTH RP (remove nothere from the email address if mailing direct) "Rex" wrote in message ... I have imported data into excel of which the content are accounting journal entries. As the comment relating to the journal ends up in column D above the journal numbers (also in column D) I need a macro that will find all of the comments that will all contain a common word such as "To" and cut and paste them into column C so that I will be able to sort the data or use pivot tables to identify duplicate entries. Any ideas appreciated! |
#3
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Thanks, I will give it a try
|
#4
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Well I gave it a try but on writing the macro and trying to run it i
got a complie error - End if without block if I am very new to VBA - all a bit confusing |
#5
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Well I gave it a try but on writing the macro and trying to run it i
got a complie error - End if without block if I am very new to VBA - all a bit confusing |
#6
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Ok, had another go and macro seemed to run OK except that it is copying
data to column C rather that cutting and pasting. Is there a way to correct this or then run a macro to delete thhe duplicates in column D? |
#7
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Dim i
For i = 1 To Cells(Rows.Count, "D").End(xlUp).Row If LCase(Cells(i, "D").Value) Like "*to*" Then Cells(i, "C").Value = Cells(i, "D").Value Cells(i, "C").Value = "" End If Next -- HTH RP (remove nothere from the email address if mailing direct) "Rex" wrote in message oups.com... Ok, had another go and macro seemed to run OK except that it is copying data to column C rather that cutting and pasting. Is there a way to correct this or then run a macro to delete thhe duplicates in column D? |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
How can I find the minium date in column B subject to data in Colu | Excel Discussion (Misc queries) | |||
Macro to find text string in a column and paste data in another | Excel Discussion (Misc queries) | |||
Macro to Find, Cut, and Paste | Excel Discussion (Misc queries) | |||
I need a macro to find cut and paste data to new cell | Excel Discussion (Misc queries) | |||
I need a macro to find cut and paste data to new cell | Excel Discussion (Misc queries) |