Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.misc
pm pm is offline
external usenet poster
 
Posts: 122
Default I need help with a macro please!

This bombs at the end - with a no cells were found message.
My objective is to copy a file to another file and delete the blank rows -
where company is blank. - Thanks for any help..

Here's an example of my file:



COMPANY VENDOR INV DESCRPT INV_AMT
3042 40315-3042 04/10 Sales Tax 0 0
1 3087 40315-3087 04/10 Sales Tax 806.48 806.48
3201 40315-3201 04/10 Sales Tax 0 0
1 3275 40315-3275 04/10 Sales Tax 27371.44 27371.44
1 3468 40315-3468 04/10 Sales Tax 155.62 155.62



Range("A1").Select
Sheets("Inv_Load to Lawson").Select

Range("A1").Select

Range(Selection, Selection.End(xlToRight)).Select
Range(Selection, Selection.End(xlDown)).Select
Selection.Copy
Workbooks.Open Filename:= _
"X:\Legal to Accounting Check Requests\Sales Tax\slsTax dbapcvi.csv"
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone,
SkipBlanks _
:=False, Transpose:=False


ActiveWorkbook.SaveAs Filename:= _
"X:\Legal to Accounting Check Requests\Sales Tax\slsTax
dbapcvi.csv", FileFormat _
:=xlCSV, CreateBackup:=False
Set r = Range("A2:A50")
Set rr = r.SpecialCells(xlCellTypeBlanks)
rr.EntireRow.Delete
  #2   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 1,522
Default I need help with a macro please!

Try it this way.

Sheets("Inv_Load to Lawson").Range("A1").End(xlToRight)).End(xlDown)). Copy
Workbooks.Open Filename:= _
"X:\Legal to Accounting Check Requests\Sales Tax\slsTax dbapcvi.csv"
activesheet.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, _
SkipBlanks:=False, Transpose:=False

activesheet.Range("A2:A50").SpecialCells(xlCellTyp eBlanks).EntireRow.Delete
ActiveWorkbook.Save

Don Guillett
Microsoft MVP Excel
SalesAid Software

"pm" wrote in message
...
This bombs at the end - with a no cells were found message.
My objective is to copy a file to another file and delete the blank rows -
where company is blank. - Thanks for any help..

Here's an example of my file:



COMPANY VENDOR INV DESCRPT INV_AMT
3042 40315-3042 04/10 Sales Tax 0 0
1 3087 40315-3087 04/10 Sales Tax 806.48 806.48
3201 40315-3201 04/10 Sales Tax 0 0
1 3275 40315-3275 04/10 Sales Tax 27371.44 27371.44
1 3468 40315-3468 04/10 Sales Tax 155.62 155.62



Range("A1").Select
Sheets("Inv_Load to Lawson").Select

Range("A1").Select

Range(Selection, Selection.End(xlToRight)).Select
Range(Selection, Selection.End(xlDown)).Select
Selection.Copy
Workbooks.Open Filename:= _
"X:\Legal to Accounting Check Requests\Sales Tax\slsTax
dbapcvi.csv"
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone,
SkipBlanks _
:=False, Transpose:=False


ActiveWorkbook.SaveAs Filename:= _
"X:\Legal to Accounting Check Requests\Sales Tax\slsTax
dbapcvi.csv", FileFormat _
:=xlCSV, CreateBackup:=False
Set r = Range("A2:A50")
Set rr = r.SpecialCells(xlCellTypeBlanks)
rr.EntireRow.Delete


  #3   Report Post  
Posted to microsoft.public.excel.misc
pm pm is offline
external usenet poster
 
Posts: 122
Default I need help with a macro please!

Don,

Now I get an application defined or object defined error on the
activesheet.pastSpecial statement.....

"Don Guillett" wrote:

Try it this way.

Sheets("Inv_Load to Lawson").Range("A1").End(xlToRight)).End(xlDown)). Copy
Workbooks.Open Filename:= _
"X:\Legal to Accounting Check Requests\Sales Tax\slsTax dbapcvi.csv"
activesheet.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, _
SkipBlanks:=False, Transpose:=False

activesheet.Range("A2:A50").SpecialCells(xlCellTyp eBlanks).EntireRow.Delete
ActiveWorkbook.Save

Don Guillett
Microsoft MVP Excel
SalesAid Software

"pm" wrote in message
...
This bombs at the end - with a no cells were found message.
My objective is to copy a file to another file and delete the blank rows -
where company is blank. - Thanks for any help..

Here's an example of my file:



COMPANY VENDOR INV DESCRPT INV_AMT
3042 40315-3042 04/10 Sales Tax 0 0
1 3087 40315-3087 04/10 Sales Tax 806.48 806.48
3201 40315-3201 04/10 Sales Tax 0 0
1 3275 40315-3275 04/10 Sales Tax 27371.44 27371.44
1 3468 40315-3468 04/10 Sales Tax 155.62 155.62



Range("A1").Select
Sheets("Inv_Load to Lawson").Select

Range("A1").Select

Range(Selection, Selection.End(xlToRight)).Select
Range(Selection, Selection.End(xlDown)).Select
Selection.Copy
Workbooks.Open Filename:= _
"X:\Legal to Accounting Check Requests\Sales Tax\slsTax
dbapcvi.csv"
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone,
SkipBlanks _
:=False, Transpose:=False


ActiveWorkbook.SaveAs Filename:= _
"X:\Legal to Accounting Check Requests\Sales Tax\slsTax
dbapcvi.csv", FileFormat _
:=xlCSV, CreateBackup:=False
Set r = Range("A2:A50")
Set rr = r.SpecialCells(xlCellTypeBlanks)
rr.EntireRow.Delete


.

  #4   Report Post  
Posted to microsoft.public.excel.misc
pm pm is offline
external usenet poster
 
Posts: 122
Default I need help with a macro please!

Hi Don,

I had to take out the second set of parenthesis in the first statement
(xlToRight)) and (xlDown)) - to be able to run the macro; however it's not
copying the data to the other file...

"Don Guillett" wrote:

Try it this way.

Sheets("Inv_Load to Lawson").Range("A1").End(xlToRight)).End(xlDown)). Copy
Workbooks.Open Filename:= _
"X:\Legal to Accounting Check Requests\Sales Tax\slsTax dbapcvi.csv"
activesheet.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, _
SkipBlanks:=False, Transpose:=False

activesheet.Range("A2:A50").SpecialCells(xlCellTyp eBlanks).EntireRow.Delete
ActiveWorkbook.Save

Don Guillett
Microsoft MVP Excel
SalesAid Software

"pm" wrote in message
...
This bombs at the end - with a no cells were found message.
My objective is to copy a file to another file and delete the blank rows -
where company is blank. - Thanks for any help..

Here's an example of my file:



COMPANY VENDOR INV DESCRPT INV_AMT
3042 40315-3042 04/10 Sales Tax 0 0
1 3087 40315-3087 04/10 Sales Tax 806.48 806.48
3201 40315-3201 04/10 Sales Tax 0 0
1 3275 40315-3275 04/10 Sales Tax 27371.44 27371.44
1 3468 40315-3468 04/10 Sales Tax 155.62 155.62



Range("A1").Select
Sheets("Inv_Load to Lawson").Select

Range("A1").Select

Range(Selection, Selection.End(xlToRight)).Select
Range(Selection, Selection.End(xlDown)).Select
Selection.Copy
Workbooks.Open Filename:= _
"X:\Legal to Accounting Check Requests\Sales Tax\slsTax
dbapcvi.csv"
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone,
SkipBlanks _
:=False, Transpose:=False


ActiveWorkbook.SaveAs Filename:= _
"X:\Legal to Accounting Check Requests\Sales Tax\slsTax
dbapcvi.csv", FileFormat _
:=xlCSV, CreateBackup:=False
Set r = Range("A2:A50")
Set rr = r.SpecialCells(xlCellTypeBlanks)
rr.EntireRow.Delete


.

  #5   Report Post  
Posted to microsoft.public.excel.misc
pm pm is offline
external usenet poster
 
Posts: 122
Default I need help with a macro please!

Don,

This would work perfectly if I could get the copy to the CSV file...any
other suggestions? Thanks.

"Don Guillett" wrote:

Try it this way.

Sheets("Inv_Load to Lawson").Range("A1").End(xlToRight)).End(xlDown)). Copy
Workbooks.Open Filename:= _
"X:\Legal to Accounting Check Requests\Sales Tax\slsTax dbapcvi.csv"
activesheet.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, _
SkipBlanks:=False, Transpose:=False

activesheet.Range("A2:A50").SpecialCells(xlCellTyp eBlanks).EntireRow.Delete
ActiveWorkbook.Save

Don Guillett
Microsoft MVP Excel
SalesAid Software

"pm" wrote in message
...
This bombs at the end - with a no cells were found message.
My objective is to copy a file to another file and delete the blank rows -
where company is blank. - Thanks for any help..

Here's an example of my file:



COMPANY VENDOR INV DESCRPT INV_AMT
3042 40315-3042 04/10 Sales Tax 0 0
1 3087 40315-3087 04/10 Sales Tax 806.48 806.48
3201 40315-3201 04/10 Sales Tax 0 0
1 3275 40315-3275 04/10 Sales Tax 27371.44 27371.44
1 3468 40315-3468 04/10 Sales Tax 155.62 155.62



Range("A1").Select
Sheets("Inv_Load to Lawson").Select

Range("A1").Select

Range(Selection, Selection.End(xlToRight)).Select
Range(Selection, Selection.End(xlDown)).Select
Selection.Copy
Workbooks.Open Filename:= _
"X:\Legal to Accounting Check Requests\Sales Tax\slsTax
dbapcvi.csv"
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone,
SkipBlanks _
:=False, Transpose:=False


ActiveWorkbook.SaveAs Filename:= _
"X:\Legal to Accounting Check Requests\Sales Tax\slsTax
dbapcvi.csv", FileFormat _
:=xlCSV, CreateBackup:=False
Set r = Range("A2:A50")
Set rr = r.SpecialCells(xlCellTypeBlanks)
rr.EntireRow.Delete


.



  #6   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 35,218
Default I need help with a macro please!

I thought your other thread got you to that point.

pm wrote:

Don,

This would work perfectly if I could get the copy to the CSV file...any
other suggestions? Thanks.

"Don Guillett" wrote:

Try it this way.

Sheets("Inv_Load to Lawson").Range("A1").End(xlToRight)).End(xlDown)). Copy
Workbooks.Open Filename:= _
"X:\Legal to Accounting Check Requests\Sales Tax\slsTax dbapcvi.csv"
activesheet.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, _
SkipBlanks:=False, Transpose:=False

activesheet.Range("A2:A50").SpecialCells(xlCellTyp eBlanks).EntireRow.Delete
ActiveWorkbook.Save

Don Guillett
Microsoft MVP Excel
SalesAid Software

"pm" wrote in message
...
This bombs at the end - with a no cells were found message.
My objective is to copy a file to another file and delete the blank rows -
where company is blank. - Thanks for any help..

Here's an example of my file:



COMPANY VENDOR INV DESCRPT INV_AMT
3042 40315-3042 04/10 Sales Tax 0 0
1 3087 40315-3087 04/10 Sales Tax 806.48 806.48
3201 40315-3201 04/10 Sales Tax 0 0
1 3275 40315-3275 04/10 Sales Tax 27371.44 27371.44
1 3468 40315-3468 04/10 Sales Tax 155.62 155.62



Range("A1").Select
Sheets("Inv_Load to Lawson").Select

Range("A1").Select

Range(Selection, Selection.End(xlToRight)).Select
Range(Selection, Selection.End(xlDown)).Select
Selection.Copy
Workbooks.Open Filename:= _
"X:\Legal to Accounting Check Requests\Sales Tax\slsTax
dbapcvi.csv"
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone,
SkipBlanks _
:=False, Transpose:=False


ActiveWorkbook.SaveAs Filename:= _
"X:\Legal to Accounting Check Requests\Sales Tax\slsTax
dbapcvi.csv", FileFormat _
:=xlCSV, CreateBackup:=False
Set r = Range("A2:A50")
Set rr = r.SpecialCells(xlCellTypeBlanks)
rr.EntireRow.Delete


.


--

Dave Peterson
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 recorded... tabs & file names changed, macro hangs Steve Excel Worksheet Functions 3 October 30th 09 11:41 AM
need help to update macro to office 2007 macro enabled workbook jatman Excel Discussion (Misc queries) 1 December 14th 07 01:57 PM
Macro Help Needed - Excel 2007 - Print Macro with Auto Sort Gavin Excel Worksheet Functions 0 May 17th 07 01:20 PM
Macro needed to Paste Values and prevent Macro operation thunderfoot Excel Discussion (Misc queries) 0 June 10th 05 03:38 PM


All times are GMT +1. The time now is 06:16 AM.

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

About Us

"It's about Microsoft Excel"