Help me pleeeeeaaassseeee

Woody75

Board Regular
Joined
Feb 26, 2012
Messages
114
Hello,

I'm really new at this VBA stuff and was wondering if someone could help me. I'm looking to use a comd button to make excel do the following things:

1. Open a specific hidden sheet

2. Copy data from a range on hidden sheet and paste to different locations on other hidden sheets.

3. Print a specific hidden sheet using the default printer

Many Thanks

Woody
 

Excel Facts

Create a Pivot Table on a Map
If your data has zip codes, postal codes, or city names, select the data and use Insert, 3D Map. (Found to right of chart icons).
Code:
Public Sub x()
    With Worksheets("Sheet1")
        .Visible = xlSheetVisible
        .Range("A1:A10").Copy Worksheets("Sheet2").Range("E5")
        .PrintOut
        .Visible = xlSheetHidden
    End With
End Sub
 
Upvote 0
So if i wanted to do a reset button. could i ise the with cmd again on different sheets?? eg open hidden "sheet1" carry out actions, print, rehide and end the with cmd. Then select another sheet using with cmd and do the same type of things again or can i be kept within the initial with cmd??? Hope i make sense...
 
Upvote 0
Sorry, I didn't follow any of that.
 
Upvote 0
for example:


Public Sub x()
With Worksheets("Sheet1")
.Visible = xlSheetVisible
.Range("A1:A10").Copy Worksheets("Sheet3").Range("A1:A10")
.PrintOut
.Visible = xlSheetHidden
End With
With Worksheets("Sheet2")
.Visible = xlSheetVisible
.Range("B1:B10").Copy Worksheets("Sheet3").Range("B1:B10")
.PrintOut
.Visible = xlSheetHidden
End With
End Sub</pre>
 
Upvote 0
If that works for you, it's golden.
 
Upvote 0

Forum statistics

Threads
1,214,601
Messages
6,120,465
Members
448,965
Latest member
grijken

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