![]() |
Loop
Hello On a daily basis I import 4 columns of data , the total number of rows is different everyday. On column C I need to delete the rows that do not contain the words , FAX, GFX, PH, TOT . Is there a macro for this ? As always Thanks |
Loop
Try:
Sub wanna() Dim r As Range, i As Long i = Range("c" & Rows.Count).End(xlUp).Row Set r = Cells(i + 1, "c") For j = 1 To i v = Cells(j, "c").Value If v = "FAX" Or v = "GFX" Or v = "PH" Or v = "TOT" Then Else Set r = Union(r, Cells(j, "c")) End If Next r.EntireRow.Delete End Sub -- Gary's Student gsnu200703 "Wanna Learn" wrote: Hello On a daily basis I import 4 columns of data , the total number of rows is different everyday. On column C I need to delete the rows that do not contain the words , FAX, GFX, PH, TOT . Is there a macro for this ? As always Thanks |
Loop
Thanks Gary's student
I have a bigger problem...I was going to create this macro and here is my story.. or should I say mess. I have 2 macro workbooks one named Personal.exl and the other MePersonal.exl. This morning I decided to save these work books to a flash drive. Then in the C drive I changed the names to Personal1.exl and MePersonal1exl now when I try to record a macro the only options I have to store the macro is PersonalMacro workbook , New Workbook and This Workbook. All Open Workbooks Options is gone. All Open Workbooks Options is gone. Help! Help! I do not have the option to save the new macro to Personal1,exl or MePersoanl.exl. Please save me !!!! Thanks "Gary''s Student" wrote: Try: Sub wanna() Dim r As Range, i As Long i = Range("c" & Rows.Count).End(xlUp).Row Set r = Cells(i + 1, "c") For j = 1 To i v = Cells(j, "c").Value If v = "FAX" Or v = "GFX" Or v = "PH" Or v = "TOT" Then Else Set r = Union(r, Cells(j, "c")) End If Next r.EntireRow.Delete End Sub -- Gary's Student gsnu200703 "Wanna Learn" wrote: Hello On a daily basis I import 4 columns of data , the total number of rows is different everyday. On column C I need to delete the rows that do not contain the words , FAX, GFX, PH, TOT . Is there a macro for this ? As always Thanks |
Loop
Gary's Student.... tried the macro it is perfect. thanks
"Gary''s Student" wrote: Try: Sub wanna() Dim r As Range, i As Long i = Range("c" & Rows.Count).End(xlUp).Row Set r = Cells(i + 1, "c") For j = 1 To i v = Cells(j, "c").Value If v = "FAX" Or v = "GFX" Or v = "PH" Or v = "TOT" Then Else Set r = Union(r, Cells(j, "c")) End If Next r.EntireRow.Delete End Sub -- Gary's Student gsnu200703 "Wanna Learn" wrote: Hello On a daily basis I import 4 columns of data , the total number of rows is different everyday. On column C I need to delete the rows that do not contain the words , FAX, GFX, PH, TOT . Is there a macro for this ? As always Thanks |
Loop
You are very welcome! W.r.t. your other problem, I don't know the answer.
-- Gary's Student gsnu200703 "Wanna Learn" wrote: Gary's Student.... tried the macro it is perfect. thanks "Gary''s Student" wrote: Try: Sub wanna() Dim r As Range, i As Long i = Range("c" & Rows.Count).End(xlUp).Row Set r = Cells(i + 1, "c") For j = 1 To i v = Cells(j, "c").Value If v = "FAX" Or v = "GFX" Or v = "PH" Or v = "TOT" Then Else Set r = Union(r, Cells(j, "c")) End If Next r.EntireRow.Delete End Sub -- Gary's Student gsnu200703 "Wanna Learn" wrote: Hello On a daily basis I import 4 columns of data , the total number of rows is different everyday. On column C I need to delete the rows that do not contain the words , FAX, GFX, PH, TOT . Is there a macro for this ? As always Thanks |
Loop
Gary"s Student Again Thanks
I did not resolve the other problem....(Kind of) I am able to create a macro to a new personal workbook, but I cannot add macros to the other Personal1.exl and MePersonal1.exl workbook Still looking for an answer "Gary''s Student" wrote: You are very welcome! W.r.t. your other problem, I don't know the answer. -- Gary's Student gsnu200703 "Wanna Learn" wrote: Gary's Student.... tried the macro it is perfect. thanks "Gary''s Student" wrote: Try: Sub wanna() Dim r As Range, i As Long i = Range("c" & Rows.Count).End(xlUp).Row Set r = Cells(i + 1, "c") For j = 1 To i v = Cells(j, "c").Value If v = "FAX" Or v = "GFX" Or v = "PH" Or v = "TOT" Then Else Set r = Union(r, Cells(j, "c")) End If Next r.EntireRow.Delete End Sub -- Gary's Student gsnu200703 "Wanna Learn" wrote: Hello On a daily basis I import 4 columns of data , the total number of rows is different everyday. On column C I need to delete the rows that do not contain the words , FAX, GFX, PH, TOT . Is there a macro for this ? As always Thanks |
All times are GMT +1. The time now is 02:17 AM. |
Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com