Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 7
Default Interrupting an add line

I am using the following code to add data to the next open line on a spreadsheet

Sub AddData(

' Macro recorded 12/8/2003 by Brian McGuir

Sheets("input").Range("A20:AB20").Copy Destination:=
Sheets("database").Cells(Rows.Count, 1).End(xlUp)
.Offset(1, 0
Worksheets("input").Range("A20:AB20").ClearContent

End Su

This works fine, but I now need to skip columns N, O, and P when adding this data. These are calculated via a formula using data from other rows, and I need to keep this formula in the destination cell for the sake of future editing of data in the actual spreadsheet. How can I still add all the columns to the next open row, but skip the three I have mentioned. Thanks in advance

Brian
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5,441
Default Interrupting an add line

Brian,

Use two lines to do the copy/paste:

Sheets("input").Range("A20:M20").Copy Destination:= _
Sheets("database").Cells(Rows.Count, 1).End(xlUp) _
.Offset(1, 0)
Sheets("input").Range("Q20:AB20").Copy Destination:= _
Sheets("database").Cells(Rows.Count,
Range("Q1").Column).End(xlUp) _
.Offset(1, 0)

HTH,
Bernie
MS Excel MVP

"Brian McGuire" wrote in message
...
I am using the following code to add data to the next open line on a

spreadsheet:

Sub AddData()

' Macro recorded 12/8/2003 by Brian McGuire

Sheets("input").Range("A20:AB20").Copy Destination:= _
Sheets("database").Cells(Rows.Count, 1).End(xlUp) _
.Offset(1, 0)
Worksheets("input").Range("A20:AB20").ClearContent s

End Sub

This works fine, but I now need to skip columns N, O, and P when

adding this data. These are calculated via a formula using data from
other rows, and I need to keep this formula in the destination cell
for the sake of future editing of data in the actual spreadsheet. How
can I still add all the columns to the next open row, but skip the
three I have mentioned. Thanks in advance.

Brian



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
How to convert a dotted line to a solid line in a line graph Sharlz Charts and Charting in Excel 1 January 14th 09 04:51 AM
Interrupting long calculations in Excel? Hi all, I am having a verylong calculation in Excel using VBA. Of course I know I can hit ESC orCTRL+BREAK to interrupt the VBA program. But I found due to too long runningprocess, the Excel window stop to LunaMoon Excel Discussion (Misc queries) 3 July 31st 08 04:47 PM
Interrupting Calculation Iterations Andrew Lee[_2_] Excel Discussion (Misc queries) 0 July 13th 07 04:30 AM
Interrupting Calculation Iterations Andrew Lee Excel Worksheet Functions 0 July 12th 07 04:38 AM
Interrupting A Worksheet Calculation carl Excel Worksheet Functions 2 November 22nd 05 07:18 PM


All times are GMT +1. The time now is 09:02 PM.

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"