View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
joel[_58_] joel[_58_] is offline
external usenet poster
 
Posts: 1
Default Macro with a memory


the first question I have to ask is the number of rows of data the same
every time you download? I suspect you are having problems deleting
data because formulas and charts are ending up with wrong references.

I think your data would be better organized if the data was in
chronological order. If the rows are the same, then moving data rather
than copying dat might work

OldRow = 10
for NewRow = 1 to Lastrow
Range("A" & NewRow) = Range("A" & OldRow)
OldRow = OldRow + 1
next Newrow

Then add the new data into the last rows.


Other solutions are

1) Use Named Ranges in the formulas and charts in you workbook which
can be accessed both by the worksheet functions and VBA. Have you macro
updated the named ranges so the formulas and charts will get the correct
data.

2) Using clearcontents method in VBA will not corrupt formulas or
charts if new data is put into the same locations.

3) Have the VBA code create the formulas and charts so yo don't have to
preserve the same range of data each time you run the macro.


--
joel
------------------------------------------------------------------------
joel's Profile: http://www.thecodecage.com/forumz/member.php?userid=229
View this thread: http://www.thecodecage.com/forumz/sh...d.php?t=146771