August 30, 2023
Hello Everyone,
I am trying to find a text in a column range in excel (say A3 to Last row of column A) and once the text is found, I want the range starting from that cell to the last row with data to be cut and paste to a different column (say starting from D3). Now i want to run a search for other text in this new range and once I find the text, I want the range starting from that cell to the last row with data to be cut and paste to a different column (say starting from G3). This will be a loop.
Please help me with this vba code.
Thank you so much in advance.
August 30, 2023
Hi Philip,
Thank you so much for the response. Please find the sample data set and the required result.
Also, I am trying with the following code(which is a part of a different loop) and when i debug it shows "nothing" in "rngx"
k=2
rmc = Sheet2.Cells(i + 2, 40).Value (rmc will be a integer)
findtext = "Message " & rmc + 1
Set rngx = ActiveSheet.Range(Cells(3, k - 1), Cells(3, lRow2)).Find(findtext, lookat:=xlPart)
k = k + 3
'ActiveSheet.Range("rngX" & lRow2).Cut Destination:=Sheets("Message Check").Cells(4, k)
ActiveSheet.Range("rngX" & lRow2).Cut
ActiveSheet.Cells(4, k).Select
ActiveSheet.PasteSpecial Paste:=xlPasteValues
Next i
Please check this and let me know if i am making sense.
1 Guest(s)