Logo 
Search:

MS Office Answers

Ask Question   UnAnswered
Home » Forum » MS Office       RSS Feeds
  Question Asked By: Laaibah Malik   on Feb 28 In MS Office Category.

  
Question Answered By: Aaleyah Khan   on Feb 28

Thanks...
I'm almost there...
I think I can setup this for each worksheet.
I tried with the first, and came up witha problem,
I used what you wrote:
With Worksheets("DMH")

For Each rngCell In .Range("d2:d15")

If Int(rngCell.Value) = rngCell.Value _
And rngCell.Value < 13 _
And rngCell.Value > 0 Then _
.Range("A2:S13", .Range("A2:S13").End(xlToRight)).Copy _
Destination:=.Range("A" & rngCell.Value * 15)

Next rngCell

End With

This works except, if there is more than one value in d2:d15(ie, 4 on
two records) it copies it twice.
I tried putting "exit sub" after Destination... line
but then get nothing..
Thanks Again...

Share: 

 

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

 
Didn't find what you were looking for? Find more on If statement in a macro ? Or get search suggestion and latest updates.


Tagged: