View Single Post
  #13   Report Post  
Posted to microsoft.public.excel.programming
Rick Rothstein Rick Rothstein is offline
external usenet poster
 
Posts: 5,934
Default Copy range if column N is empty

See inline comments....

Thanks for the quick response.
The sales sheets contains the current month sales and is emptied at the
end
of each month. No problems doing that.


Okay, so you start off the month with a completely blank sheet (except for
the column headers).


Before updating the carryover sheet we need to clear the delivered cars on
that sheet(Column N will have data-salesperson's initials.) leaving the
rows
where column N is empty.
First we need some code to do this.


Why? (See the rest of my comments before answering this.)

Then we need to copy the carryovers from the sales sheet to the
last used row on the carryovers sheet.


For the code I posted, leaving the rows where Column N cells have entries in
them does not interfere with moving the data for those rows where Column N
cells are blank. What I am having trouble visualizing is what should be
remaining on the Sales sheet **after** the data in Columns A thru T is moved
to the Carryovers sheet. I thought you were saying the carried over data
plus any other columns associated with it should remain (you mentioned
something about data in columns after Column T). That is what the last macro
I posted does. Can you clarify this point for me? The key thing from my
standpoint (as someone who does not know your business model) is in
understanding what you have on your two sheets before you start the macro
and what you want to have on those sheets after the macro is done. I though
I understood it all when I supplied my last macro, but now I am not so sure.
So, if you can clarify what you have before the macro and what you what
afterwards, that would be helpful.


Garry's code sample


I think you mean JLGWhiz's code sample... Garry did not post any code to
this thread (I beat him to it<g).


.....does this part exactly how we want it but is slower than
your sample ( not suitable as it overwrites existing data). Not sure if
there
is a faster macro to do what your example does but puts the data in the
last
used row.


Okay, I may have missed the "existing data" part in your earlier posts
(mainly because you said to put the data starting in A2 on the Carryovers
sheet). Are you saying the carryovers (Column N cells are empty) are
cumulative over on the Carryovers sheet? That is, is there already data on
the Carryovers sheet that the new data needs to be placed after? If so, it
is easy enough to modify either of my codes to do that, but I don't know
which of my macros you actually need. Once you provide the clarification I
asked for above, I will know how to respond to you.


Good luck in your endeavours whatever the outcome of your MVP status
is. My philosophy on voluntary activities is simple. If it stops being
enjoyable
then give it away.


Oh, don't get me wrong, answering Excel questions on newsgroups is most
enjoyable to me, but there are other things that I find equally enjoyable as
well but which I don't pursue because of the time commitment. I used to be a
prolific contributor to various anagramming websites in the past (one site
that cataloged some of my earlier work is
http://www.anagramgenius.com/agasear...in&type=author and
you can Google my name and the word anagrams to see others), but my efforts
have been way down on this front for several years now; there is this
president of a company I know that makes a programming language compiler who
has been after me for years adopt his language and offer my "talents" (if
that is the right word) in support of it; I enjoy photography (mostly family
events) and using Photoshop to "fix" the pictures; and so on, and so on.
There is lots I like to do and not enough time to do it all in. The MVP
award has kept me tethered to the Microsoft world, but if I should lose that
status (which for various reasons I think may happen), I would consider
myself free to explore things outside of Excel.

--
Rick (MVP - Excel)