Kamis, 18 Februari 2016

Re: [ExcelVBA] Code that needs help

 

sub Delete_2033_Types()
'line below deletes rows that do not have a number value assigned in column 3
lrow = Cells(Rows.Count, 1).End(xlUp).Row
For i = lrow To 2 Step -1
x=cells(i,3)
If Not IsNumeric(x) Then
 Rows(i).Delete
else if x=20 or x=33 then
rows(i).delete
else
end if
end if
Next i
End Sub

On Fri, Feb 19, 2016 at 4:38 AM, Dr John C Bullas john.bullas@gmail.com [ExcelVBA] <ExcelVBA@yahoogroups.com> wrote:
 

What have you tried? 

Dr B 

On 18 February 2016 at 04:59, mgarza@fellowes.com [ExcelVBA] <ExcelVBA@yahoogroups.com> wrote:
I have code that I want to modify if possible. The object of this code is to delete rows that contain a specific value in a specific column. Here is what I am using now:

Sub Delete_2033_Types()
'line below deletes rows that do not have a number value assigned in column 3
    lrow = Cells(Rows.Count, 1).End(xlUp).Row
    For i = lrow To 2 Step -1
    If Not IsNumeric(Cells(i, 3)) Then Rows(i).Delete
    Next i
End Sub
How can I modify this so that if the value in column 3 equals the integer 20 or 33 it will be deleted?

------------------------------------
Posted by: mgarza@fellowes.com
------------------------------------

----------------------------------
Be sure to check out TechTrax Ezine for many, free Excel VBA articles! Go here: http://www.mousetrax.com/techtrax to enter the ezine, then search the ARCHIVES for EXCEL VBA.

----------------------------------
Visit our ExcelVBA group home page for more info and support files:
http://groups.yahoo.com/group/ExcelVBA

----------------------------------
More free tutorials and resources available at:
http://www.mousetrax.com

----------------------------------
------------------------------------

Yahoo Groups Links

<*> To visit your group on the web, go to:
    http://groups.yahoo.com/group/ExcelVBA/

<*> Your email settings:
    Individual Email | Traditional

<*> To change settings online go to:
    http://groups.yahoo.com/group/ExcelVBA/join
    (Yahoo! ID required)

<*> To change settings via email:
    ExcelVBA-digest@yahoogroups.com
    ExcelVBA-fullfeatured@yahoogroups.com

<*> To unsubscribe from this group, send an email to:
    ExcelVBA-unsubscribe@yahoogroups.com

<*> Your use of Yahoo Groups is subject to:
    https://info.yahoo.com/legal/us/yahoo/utos/terms/




--

          ===========================
      LinkedIn: http://uk.linkedin.com/in/drjohnbullas
      Check out Google Apps!: https://goo.gl/yzRb3S
Mini Xmas Gifts: http://fatblokeracing.org/minibooklist.shtml


__._,_.___

Posted by: Pramod Kulkarni <auddhav@gmail.com>
Reply via web post Reply to sender Reply to group Start a New Topic Messages in this topic (3)
----------------------------------
Be sure to check out TechTrax Ezine for many, free Excel VBA articles! Go here: http://www.mousetrax.com/techtrax to enter the ezine, then search the ARCHIVES for EXCEL VBA.

----------------------------------
Visit our ExcelVBA group home page for more info and support files:
http://groups.yahoo.com/group/ExcelVBA

----------------------------------
More free tutorials and resources available at:
http://www.mousetrax.com

----------------------------------

.

__,_._,___

Tidak ada komentar:

Posting Komentar