Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Macro to delete row if value in column J =0


I export data from Quickbooks into excel. Quickbooks unfortunately doe
not let me filter the data with two variable, because if should be <0
In Quickbooks you can only filter on = or or <.
So I export this huge data block into excel to then import int
access.

When the data is imported into access, I run a macro which massages th
data into a format access can use.
I now have more then 10,000 rows to copy and it has reached the limi
of some of the computers memory.
Out of the 10,000 or more transactions, there are more 4,000 items wit
the value of zero, which I can get rid of.
I would like to be able to add some lines to go through the rows an
delete all rows where the value in column J=0.
Thank for any help.
Ann

--
anne
-----------------------------------------------------------------------
annep's Profile: http://www.excelforum.com/member.php...fo&userid=1885
View this thread: http://www.excelforum.com/showthread.php?threadid=49708

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 4,339
Default Macro to delete row if value in column J =0

Anne,

Try this:

Sub DeleteJisZero()

Dim lastrow As Long, r As Long

lastrow = Cells(Rows.Count, "J").End(xlUp).Row

For r = lastrow To 2 Step -1
If Cells(r, "J") = 0 Then
Rows(r).EntireRow.Delete
End If
Next r

End Sub

HTH

"annep" wrote:


I export data from Quickbooks into excel. Quickbooks unfortunately does
not let me filter the data with two variable, because if should be <0.
In Quickbooks you can only filter on = or or <.
So I export this huge data block into excel to then import into
access.

When the data is imported into access, I run a macro which massages the
data into a format access can use.
I now have more then 10,000 rows to copy and it has reached the limit
of some of the computers memory.
Out of the 10,000 or more transactions, there are more 4,000 items with
the value of zero, which I can get rid of.
I would like to be able to add some lines to go through the rows and
delete all rows where the value in column J=0.
Thank for any help.
Anne


--
annep
------------------------------------------------------------------------
annep's Profile: http://www.excelforum.com/member.php...o&userid=18851
View this thread: http://www.excelforum.com/showthread...hreadid=497087


  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Macro to delete row if value in column J =0


Works very nice.
I have another question.
How can I combine the two macros?
I would like for this macro to complete and then run my other macro,
which is Sub ExportGLTrans()?
Thanks,
Anne


--
annep
------------------------------------------------------------------------
annep's Profile: http://www.excelforum.com/member.php...o&userid=18851
View this thread: http://www.excelforum.com/showthread...hreadid=497087

  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 709
Default Macro to delete row if value in column J =0

annep, just add the name to the bottom of the macro, like this,

Sub DeleteJisZero()

Dim lastrow As Long, r As Long

lastrow = Cells(Rows.Count, "J").End(xlUp).Row

For r = lastrow To 2 Step -1
If Cells(r, "J") = 0 Then
Rows(r).EntireRow.Delete
End If
Next r
ExportGLTrans
End Sub


--
Paul B
Always backup your data before trying something new
Please post any response to the newsgroups so others can benefit from it
Feedback on answers is always appreciated!
Using Excel 2002 & 2003

"annep" wrote in
message ...

Works very nice.
I have another question.
How can I combine the two macros?
I would like for this macro to complete and then run my other macro,
which is Sub ExportGLTrans()?
Thanks,
Anne


--
annep
------------------------------------------------------------------------
annep's Profile:

http://www.excelforum.com/member.php...o&userid=18851
View this thread: http://www.excelforum.com/showthread...hreadid=497087



  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Macro to delete row if value in column J =0


Too simple
I love it,
Anne:

--
anne
-----------------------------------------------------------------------
annep's Profile: http://www.excelforum.com/member.php...fo&userid=1885
View this thread: http://www.excelforum.com/showthread.php?threadid=49708



Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Macro to delete Column Kim Excel Discussion (Misc queries) 1 September 21st 09 12:09 PM
Macro to Delete first words in a column Jeff[_4_] Excel Discussion (Misc queries) 12 October 19th 07 10:33 PM
macro to delete the last value in each column z.entropic Excel Worksheet Functions 11 July 21st 07 01:10 PM
Delete a Column when in a Macro-Worksheet Event? jeannie v Excel Worksheet Functions 2 July 19th 07 01:58 AM
macro to delete entire rows when column A is blank ...a quick macro vikram Excel Programming 4 May 3rd 04 08:45 PM


All times are GMT +1. The time now is 02:19 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"