Logo 
Search:

MS Office Answers

Ask Question   UnAnswered
Home » Forum » MS Office       RSS Feeds
  Question Asked By: Jodon Brown   on Nov 12 In MS Office Category.

  
Question Answered By: Arnelle Schmidt   on Nov 12

I can see something that is probably giving you trouble ...

You are using a counter LColumn to track across your sheet  to find the correct
column. However, you then explicitly select C7 and C16 as the destinations for
your pastes. I imagine you want Cells(7, LColumn) - and another one for row  16
- as your destinations.

I also suggest that you remove the CutCopyMode = False statement, or move it
away from where it is between the Select and the Copy. It's probably not
causing trouble, but it's inappropriate to have it where it is.

Notes for future reference (once it's working, these things are worth trying as
improvements) ...

Don't say

While LFound = False

say

While Not LFound

Don't use Select statements when they're not needed. E.g.

Sheets("Daily").Select
Range("I6:L6").Select
Selection.Copy
Sheets("4 Week stock").Select
Cells(7, LColumn).Select
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone,
SkipBlanks:=False, Transpose:=True

can be replaced with

Sheets("Daily").Range("I6:L6").Copy
Sheets("4 Week stock").Cells(7, LColumn).PasteSpecial Paste:=xlPasteValues,
Operation:=xlNone, SkipBlanks:=False, Transpose:=True

and has the added benefit of running faster, because it doesn't have to make the
two sheets alternately visible.

Share: 

 

This Question has 1 more answer(s). View Complete Question Thread

 
Didn't find what you were looking for? Find more on Creating a stock control sheet Or get search suggestion and latest updates.


Tagged: