469,954 Members | 1,722 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,954 developers. It's quick & easy.

VBA Macro in Excel

I am working on a VBA macro in Excel that will copy a sheet move it and then rename it based on what the user enters in a pop up box. Here is my code for the module:

frmShow.Show

Sheets("Jun 09 New").Select
Sheets("Jun 09 New").Copy Before:=Sheets(frmShow.txtCopySheet.Text)
Sheets("Jun 09 New (2)").Select
Sheets("Jun 09 New (2)").Move After:=Sheets(frmShow.txtCopySheet.Text)
Sheets("Jun 09 New (2)").Select
Sheets("Jun 09 New (2)").Name = frmShow.txtNewSheet.Text
Columns("I:I").Select
Selection.Copy
Columns("H:H").Select
Selection.Insert Shift:=xlToRight
Columns("J:J").Select
Application.CutCopyMode = False
Selection.ClearContents
Range("J1").Select
Selection.NumberFormat = "@"
Range("J1").Select
ActiveCell.FormulaR1C1 = frmShow.txtNewSheet.Text
Range("J2").Select




Where it has Sheets("Jun 09 New") is there a way to put the text property of a text box like I have on this line of code Sheets("Jun 09 New").Copy Before:=Sheets(frmShow.txtCopySheet.Text). It works as is, but I want to be able to have the user select a sheet to copy, then place it after that and name it the Name they put in the text box.
Jun 11 '09 #1
1 2487
Dököll
2,364 Expert 2GB
@mmurphmsu
Looks like nice work partner, I'll send over to VBA for added input for ya... Hope you get what you're looking for.

Good luck!
Jun 17 '09 #2

Post your reply

Sign in to post your reply or Sign up for a free account.

Similar topics

4 posts views Thread by Rich Wallace | last post: by
3 posts views Thread by Mr.Doubt | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.