Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.misc
|
|||
|
|||
![]() 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 |
#2
![]()
Posted to microsoft.public.excel.misc
|
|||
|
|||
![]()
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 |
#3
![]()
Posted to microsoft.public.excel.misc
|
|||
|
|||
![]()
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 |
#4
![]()
Posted to microsoft.public.excel.misc
|
|||
|
|||
![]()
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 |
#5
![]()
Posted to microsoft.public.excel.misc
|
|||
|
|||
![]()
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 |
#6
![]()
Posted to microsoft.public.excel.misc
|
|||
|
|||
![]()
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 |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Using a for loop | Excel Discussion (Misc queries) | |||
how to put a loop in a macro? | New Users to Excel | |||
Loop time seems dependent on unrelated workbook - Why? | Excel Worksheet Functions | |||
Loop gone crazy | Excel Discussion (Misc queries) | |||
Do Loop | Excel Discussion (Misc queries) |