Requirement:
The user wants to find value contains in column B and if found copy them to column A in the same row. For example if the value in B4 contains my search value i.e "*CASH*" then copy that to A4 and the same goes to the rest. The user has a macro given in the attached .xls but if run this in sheet1 the result will be like as given in "macro test result" sheet without giving the one required like as shown in "result needed" sheet. can anyone help on this code?
Solution:
Sub Test() Dim bottomB As Integer bottomB = Sheets("Sheet1").Range("B" & Rows.Count).End(xlUp).Row Dim c As Range For Each c In Sheets("sheet1").Range("B1:B" & bottomB) If c.Value Like "*CASH*" Then c.Copy Worksheets("Sheet1").Range("A" & c.Row) End If Next c End Sub
Obtained from the OzGrid Help Forum.
Solution provided by Carim.
See also: Index to Excel VBA Code and Index to Excel Freebies and Lesson 1 - Excel Fundamentals and Index to how to… providing a range of solutions and Index to new resources and reference sheets
See also:
Click here to visit our Free 24/7 Excel/VBA Help Forum where there are thousands of posts you can get information from, or you can join the Forum and post your own questions.