Logo 
Search:

MS Office Answers

Ask Question   UnAnswered
Home » Forum » MS Office       RSS Feeds
  Question Asked By: John Cooper   on Nov 26 In MS Office Category.

  
Question Answered By: Jae Williams   on Nov 26

I am very pleased you want to try to do this yourself. It is just the kind of
exercise to learn on.

I would suggest
- step through each row  on the sheet using a for - next loop for the row
number,
- look at H & Row Number.
If it is "Complete" then
copy E & row Number to H & Row Number
move to the target sheet,
paste in the relevant cells
increment the target row number
switch back to the source sheet

You could speed up this process if for example there are always 48 weeks but
it probably does not matter much. Try to make something that works, even if
it is not the prettiest solution.

Some things you should try to do.

Put "Option Explicit" at the top of the module. This forces you to declare
(Dim) every variable. It is a valuable way to catch typos, especially if you
go Debug/Compile before you try to run it. I always do these two things.

Also if you declare the type of each variable it helps intellisense to work
and clue you in on the methods and properties you can use.

Frex: Dim wsSource as Worksheet


Use the range object to refer to cells rather than selecting the cells.
Doesn't matter for this exercise but when you get to do other things it speeds
them up no end as well as making your code more precise. So use Range(E &
RowNum).value rather than

Selection.offset(3).Activate
Selection.value

If you get stuck please post your code here and we will help.

Share: 

 
 
Didn't find what you were looking for? Find more on Find next value Or get search suggestion and latest updates.


Tagged: