Creating a print-macro that'll only print page 1?
I have a spreadsheet that contains multiple sheets. I want to add a
button that runs a macro, which only prints page 1 on the first sheet
The "Scorekort" sheet contains 13 pages in total, but I only want to
print the first page.
Any ideas for this macro?
Sheets("Scorekort").PrintOut From:=1, To:=1, Copies:=1, Preview:=True, Collate:=True
if you don't want a print preview, Preview:=False
Le 2011-05-21 04:16, Anders M a �crit :
> I have a spreadsheet that contains multiple ...Excel VBA #4
I'm very new to VBA and could use a little help. I wrote a macro that
does the following:
Unprotects the sheet; then does a file Save As to a specific folder and
then goes to Cell P2.
All is fine except the macro didn't record the password and I have to
type it in everytime. So it's prompting me for the password everytime.
During the file Save As operating, it says such & such file already
exists, do you want to replace? The answer is always going to be YES.
How do i make that happen?
Once Cell P2 is activated, I type in a code (number) for that...VBA Code not shown
I have a Excel File containing VBA macros.
But when i want to view the VBA code by going to the does not ask for
password as it is expected for a Password Protected Project. Else, it
says, project is unviewable. Why is that? Is this something else
except a VBA Excel File? How can i see the code?
Thanks in Advance.
Is the workbook shared?
What version excel created the workbook?
What version of excel are you using to try to open the project?
> I have a Excel File containing VBA macros.
> But when i want to view the VBA code by going to the does not a...get rid of macro option at startup
I created and then deleted a macro in an Excel file.
Why do I still get the warning box (i.e. the one asking if I want to enable
or disable macros) when I open the file?
Is there a way to get rid of this since I no longer have macros in this
You need to delete the empty module.!
"Brad Rench" <firstname.lastname@example.org> wrote in message
> I created and then deleted a macro in an Excel file.
> Why do I still get the warning box (i.e. the one asking if I want to
> or disable macros) when I o...Macro's with Ctrl or Ctrl-Shift?
When you record a new macro it asks you what Ctrl key you want to access it
with. If you Edit the Properties of a Macro it asks you what Ctrl-Shift key
you want to use to access a macro. How can you have more control over this
to assign the proper key to a macro? Thanks.
I don't know what you mean by "edit the properties of a macro." You can
assign a Ctrl or Ctrl-Shift combination (excluding number keys) to macros
either when about to record a macro, or later with Tools - Macro - Macros -
Options. If by "have more control," you mean keys other than C...SOAP Call from VBA?
Can anyone point me to some good examples online of how to make a SOAP
call from VBA in access? I am using Access 2003 and would like to be
able to submit an XML file via a SOAP call and get the result message
You can find the web services add-in for access 2003 here:
In many cases, you find it better off to use the msXML library in place of
the soap add-in.
It a lot less code
Public Sub GetQuote2()
Dim objXML As Object
Di...Somehow I created a Macro in a worksheet.
I created a macro in an Excel worksheet somehow.
I didn't try to, it just happened. Now everytime I open that workbook, it
asks me if I want to run the macro, disable it, etc.
How the hell do I get rid of the macro? It doesn't show up under tools,
macros. And it apparently doesn't do anything either because I can disable
it and nothing different happens.
Who invented this system anyway?
When you record a macro, a module is created to store the macro code.
There are instructions here for removing the module that is causing the
prompt to appear:
i have a worksheet that shows worktimes for employees, the cells ar
grey, when you enter the employees time or "shift" and press a butto
that executes my macro, it changes the colour of the "shift" to whit
to show the time scale that the employee is working. the macro run
fine, the problem is that to run the macro i have to click a button. i
there a way of running the macro, or executing the code when i ente
the employees "shift" of time. or is this not possible?
this is the code i am using at the minute for it to run when i click o
Private Function Sh...macro command
Hi all i had a problem of shifting selected rows one cell to the right, the
data looks like this:-
328 Sales $ 0 0 0 0 0 0
Qnty 0 0 0 0 0 0 0
509 Sales $ 0 0 0 0 0 0
Qnty 0 0 0 0 0 0 0
ALEX Sales $ 0 0 0 0 0 0
Qnty 0 0 0 0 0 0 0
ALJ Sales $ 0 0 0 0 0 0
Qnty 0 0 0 0 0 0 0
ANCH Sales $ 0 0 0 0 0 0
Qnty 0 0 0 0 0 0 0
ANG Sales $ 0 0 0 0 0 0
Qnty 0 0 0 0 0 0 0
ANSON Sales $ 0 0 0 0 0 0
Qnty 0 0 0 0 0 0 0
BEDOK Sales $ 0 0 0 0 0
Qnty 0 0 0 0 0 0 0
As what you have see the qnty column is not same as the sales column and i
had hundred thousand of rows to cut and paste.
...Solver add-in and macros
I just got a new computer with XP and Excel 2003 and
tried to run a macro that used to SOLVER add-in function
and got a compile error. As a test I recorded a macro
using the SOLVER and got the same result when I tried to
run that macro. The Compile Error is "Sub or Function
not defined". On the Knowledge Base it says I need to
add SOLVER to the list of References in the VB Editor.
When I go to the references list, SOLVER does not
appear. When I open Help for VB and search for SOLVER,
it finds nothing. What is going on? Why doesn't VB even
recognize the existence ...Excel / VBA / SQL DB
Anybody done any work with Excel / VBA / SQL DB?
Can you give me some pointers on how I could do the following all in one VBA
1) From a cell variable value (ie, user enters a customer code), I query
table A and put the data into a worksheet starting from say cell A1.
2) A blank row is created after the last data line in point 1 above.
3) Using the same cell variable, query table B and put the data into the
worksheet starting from the row after the blank row in point 2 above.
and so on.
Like I've said before I work with ASP all day and know about ADO
connections, commands and...XL 2007: How to find out what keyboard shortcuts I've assigned to macros?
Over the years, I've recorded and written a lot of macros. (Probably
time to take a week or two and go over them and delete at least
half!) I assigned a keyboard shortcut to a lot of them.
I seem to remember that before XL 2007, there was a keyboard organizer
that I could go through and review what shortcuts I had already
assigned to my macros. I can't find that in 2007, though.
Is there an easy way to generate a list of all my keyboard assignments
and what macros they go to?
I don't recall ever seeing any such keyboard organizer in 2007.
Canned from a prev...VBA Error Message "Compile Error...."
I used a macro from Ron's website to mail each worksheet to the email
address in cell a1. I ran this macro and it worked perfectly for one
workbook BUT... when I tried to use it for another workbook I got the
follwing error message "Microsoft Visual Basic Compile Error Can't find
project or library Ok Help".
Help me please... do I have to check some more references in the VBA tools?
Have you set the reference to Outlook in that other workbook also ?
You must do that in every workbook or you can use Late binding.
See my site for a example
--...Pivot tables and Macros
I was looking to be able to manipulate (ie change selections from the
drop downs, not change the fields in the table or anything)and print
from a pivot table using a macro.
So how do I go about doing that?
When I set up a macro by recording the actions that I want to do, I
always get an error message when I try to run it as a macro.
What specific steps are you recording, and what error message do you get?
Can you click the Debug button, and see the line of code that is causing
Dust For Eyes wrote:
> I was looking to be able to manipulate (ie change selections from the
>...Macro changes color
I have the following macro to set chart fonts to arial 10.
But If I apply this macro to a chart that already has fonts colored
differently (lets say some are red, some blue, some white) it changes
all fonts to black. I tried to remove ColorIndex hoping i would than
ignore color, but it doesn't help. How to make macro that will not
change the set colors in the chart?
Selection.AutoScaleFont = False
.Name = "Arial"
.Size = 10
.Strikethrough = False
.Superscript = False
.Subscript = False
Anyone have suggestions on publications for the beginner
VBA user? (particular author, etc.) All recommendations
My suggestion would be to start with the online free Tutorials
and then move up to purchasing a book.
perhaps starting with
Microsoft Excel for Windows -- Visual Basic for Applications 101 �
VBA 101, meaning, of course, an introductory course in VBA
Starts of with Recording Your First Macro, Runnin...Problem with vba code to export query result in excel
I have a access report that exports to excel with click of a button after
choosing parameters. This works well. However I have to modify couple of
fields to utilize formula in the export module. I am not sure how to do this.
I am writing the above code which seems to cause problem. I appreciate any
help to resolve this issue. Thanks.
If lngColumn = 12 Then
xlc.Offset(0, lngColumn).Value = =([UnitPrice]*[OriginalShippedQty])/1000
It seems the fields UnitPrice and OrigianalShippedQty are not being
>I have a acces...Create Excel macro for barcode output
I am looking for suggestions or samples of an Excel macro that will output
barcodes that can be printed and then attached onto loan documents.
Example: input loan # 555 and print off 20 barcoded labels - each label
contains loan number + the document type.
you don't need a macro for that. we just got throught
barcodeing our part numbers in the ware house and used
excel and no macro.
bar codes are just another font. excel uses 3 0f 9 barcode
font. you can download others off the net.
you can format a cell with this font and it will show as
barcode on the sheet and numbers in th...Macro's for figuring Price Lists?!?
I'm working on price books for the company I work for. The vendors just
email us the suggested retail price in excel format. I have to put in a
formula to come up with "Our Cost" and a formula for "Our Retail". The
problem is - The "Suggested Retail" is in a different column on each
worksheet. For example on one worksheet the "Suggested Retail" is in column
"G", and on the next worksheet it is in column "H". Can a macro be created
and automatically look for the suggested retail price column rather than
specifying colum...Switching Accounts on Download
To Whom Can Help:
MS Money 2007 has started downloading account information into the wrong
account--it is swapping it with another account.
This happened in a previous version of Money and I don't know how to correct
In the previous version it was with a Banking account--two savings accounts
from the same institution.
In this incarnation, it is with two investment accounts--mutual fund versus
brokerage account--but from the same institution.
Anyone have this happen to them...anyone know of a solution?
Thanks for your help.
In microsoft.public.money, golfbum71 wrote:
...naming a workbook from a cell (macro?)
A user wants to name a workbook the name that is entered in a particular cell. (A Purchase Order, for example). After they populate the cell, can a macro be executed to copy the cell, and paste into the save as dialog box? I've tried, but the paste doesn't work for me... We are using Excel 2003.
You can paste this code into the worksheet module concerned. Right-click
the sheet tab and select 'view code'
Private Sub Worksheet_Change(ByVal Target As Range)
If Not Application.Intersect(Target, Range("A1")) Is Nothing Then
ThisWorkbook.SaveAs Filename:=...passeord Protect for excel formula and VBA code
i have excel sheet its contain lot of formula and VBA(macro) code,
its for used for user purpose,
i need how to protect the formula and VBA at the time of user using.
kindly let me know , kindly help me out
i need user password : for user can upload the data in non restriction
admin password : can change any thing(change power)
pls help me,
Please ask on the Excel board.
> i have excel sheet its contain lot of formula and VBA(macro) code,
> its for used for user purpose,
> i need how to protect the formula and ...VBA project locked
While importing the Calender package (Calendar80.Package) i got the
"Package contains items that cannot be imported becuase their VBA project
Date Dialong , Microsoft Calender control 11.0 and Rm_Analysis Report were
shown as locked
How to resolve this ?
...Altering the range that is plotted by a chart via VBA
Good morning all.
I haven't really done a huge amount on charting, so I'm sure you'll think
that these questions are a bit simplistic, but here goes!
I plot a chart from a worksheet that contains three columns of data - the X
axis contains week numbers, and is in B29:B54. Actual hours are entered in
F29:F24 and cumualtive hours in G29:G24. The cumulative formula is of the
So, each week, in order to plot another week's data, I have to copy this
cumulative formula down by one cell, which, considering I have a lot of these
reports, is a bit time cons...VBA macros
I have a project that has 6 macros defined with only 1 sheet which
is named PTS08. I would like to run one of the macros. They all open
text files. Let's suppose one of them is ADPS08.TXT. I want this file to
go into a sheet called ADP. The sheet doesn't exist. How do I do this?
Posted via a free Usenet account from http://www.teranews.com
Regards Ron de Bruin
"Pierre Fichaud" <email@example.com> wrote in message news:firstname.lastname@example.org...