macro copy problem

J

JaimeTimbrell

Hello All,

I am very new tomacros and VBA and I have a question relating to a copy
problem.

The problem I have is in automating the number of rows down with which I
copy a range of cells.

At present in the macro I have this bit:

Range("T5:AC5").Select
Application.CutCopyMode = False
Selection.Copy
Range("T6:T1008").Select
ActiveSheet.Paste

now rather than '1008' I want the 1008 bit to be a number that appears in
cell T1 (the number is different from sheet to sheet).

How do I do that? I have tried for quite a while to find the solution using
a lot of excellent MVP websites, but alas the problem appears to in my
interpretation of their help!

Regards,
Jaime.
 
J

JE McGimpsey

See one answer in microsoft.public.excel.programming


Please don't post the same question in multiple newsgroups. At best, it
tends to fragment your answers. It also tends to waste the time of those
answering questions that have already been answered in another group.
For tips on using these groups effectively, see

http://cpearson.com/excel/newposte.htm
 
F

flummi

Try t organize the T1 bit in all worksheets to be in the same cell say
A1 and try this example.

EndRow = Range("a1").Value
Range("T5:AC5").Select
Application.CutCopyMode = False
Selection.Copy
Range("T6:T" + CStr(EndRow)).Select
ActiveSheet.Paste
 
J

JaimeTimbrell

Thanks for your help. Sorry I didnt realise that all the sites were linked
and that I was causing a problem.
 
J

JaimeTimbrell

Thanks very much for your help. I will also try this approach and see which
is the best - thanks again.
 
Top