automatically pasting cell into different sheets?

  • Thread starter Thread starter compitus
  • Start date Start date
C

compitus

Hi! I am trying to get Excel to copy content of some cells to next sheets,
depending on the number I put in last cell. IE A1:A3 have some text. Now, if
I put number (2,3,4 or 5) in A4, I wanted to copy A1:A4 to Sheets 2,3,4 or5,
depending which number I put in A4 (if 2, then to Sheet s, if 3 to Sheets 2
and 3 and so on).
Is this doable in Excel or should I use Visual Basic or some other program?
Thank You for help
 
You don't provide any details about what you are trying to do so I just took
what you say literally. The following macro does what you say you want.
Paste this macro into a regular module. Place a button on the first sheet,
if you wish, to run the macro. The macro will copy A1:A3 and put it in
A1:A3 of the sheet named in A4 of the first sheet.
I'm sending you, direct, a small file that contains this macro in the
proper module. I'm sending this to the email address displayed in your
message. HTH Otto
Sub CopyData()
Range("A1:A3").Copy Sheets(Range("A4").Value).Range("A1")
End Sub
 
Back
Top