Copying a sheet to a certain position

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Hi there

I have this code:

Windows("Feedback Form.xls").Activate
ActiveSheet.copy Before:=Workbooks("Feedback Master Sheet.xls"). _
Sheets(2)

to copy a worksheet into another spreadsheet.

I want to be able to copy the sheet to a specific position in feedback
Master Sheet.xls

on the spreadsheet (feedback form.xls) in cell O5 I have a possibility of 3
sheet names that I want the copied sheet to be placed before. These are
Alend, JLend, GWend.

Is it possible to write a piece of code that copies the worksheet to before
ALend if O5 = ALend and before JLend if O5= JLend etc

Any help given is greatly appreciated

Thanks in advance

Jamie
 
Is this what you are after?

Dim Before As String

Before = ActiveSheet.Range("O5")

ActiveSheet.copy Before:=Workbooks("Feedback Master Sheet.xls"). _
Sheets(Before
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top