VBA command to move contents from 1 sheet to another

Chandana_Gadugu

New Member
Joined
Dec 2, 2009
Messages
24
Hi,

Below is the command which is used in my previous version of excel i.e excel 2003 to move the contents of 1 sheet to another

Worksheets(MySName).Move After:=ThisWorkbook.Sheets(1)

But the same command is not working in excel 2007 and excel 2010.

Can anybody help me regarding the same.

Thanks in Advance,
Chandana.G
 

Excel Facts

What is the shortcut key for Format Selection?
Ctrl+1 (the number one) will open the Format dialog for whatever is selected.
The original code seems to work for me.

Double check that the variable MySName is correct and that there is a sheet named the same.


<font face=Courier New><SPAN style="color:#00007F">Dim</SPAN> mysname <SPAN style="color:#00007F">As</SPAN> <SPAN style="color:#00007F">String</SPAN><br><br>mysname = "Sheet1"<br><br>Worksheets(mysname).Move After:=ThisWorkbook.Sheets(1)</FONT>
 
Upvote 0

Forum statistics

Threads
1,222,248
Messages
6,164,814
Members
451,918
Latest member
Pinnacleinfotechcad

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top