Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 16
Default Help with Macros

Hey all,

I was hoping that somebody out there may be able to help me with some macro
issues and questions.

First off, I have this line in a macro I have made:

Worksheets("Claim Label Template").PageSetup.PrintArea = "$A$1:$I$26"

this works well, but the problem is in another macro whereby there is to be
variable amount of lines.

I have a variable that always knows how many lines in the sheet there are,
and the columns are a constant. Problems is I aways get a run time error
1004 attempting to make this statement variable. I have tries using range
cells, but all with the same error. Is there a smiple code liek the one I
have mentioned that will take, say R for rows, and allow me to set the print
area to the number of rows up to column d?


Beside this, I am curious to know if it is possible to do the follwoing:

At work, we have Adobe Acrobat installed. We have a task ahead whereby we
will need to get several pdf files and join them into one file. This task
needs repeating many times for different files.

I can select on the files and right click to get the option to join the
files then acrobat launches in and joins them, then I have to save them.

Is it possible to write an macro in excel to read file names, say along each
row and somehow have excel (through the macro) run acrobat, joining these
files together, then saving the result in a directory that will change name
for each conglomeration?

Any help is very much appreciated!

Regards,
Clint


  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 10,124
Default Help with Macros

something like
Sub setprintareasheet1()
With Sheets("sheet1")
'automatic
r = .Cells(Rows.Count, "k").End(xlUp).Row
'or ask for input
'r=inputbox("number of rows please)
..PageSetup.PrintArea = Range("a2:k" & r).Address

End With
End Sub

--
Don Guillett
SalesAid Software

"Clinton M James" wrote in message
...
Hey all,

I was hoping that somebody out there may be able to help me with some
macro issues and questions.

First off, I have this line in a macro I have made:

Worksheets("Claim Label Template").PageSetup.PrintArea = "$A$1:$I$26"

this works well, but the problem is in another macro whereby there is to
be variable amount of lines.

I have a variable that always knows how many lines in the sheet there are,
and the columns are a constant. Problems is I aways get a run time error
1004 attempting to make this statement variable. I have tries using range
cells, but all with the same error. Is there a smiple code liek the one I
have mentioned that will take, say R for rows, and allow me to set the
print area to the number of rows up to column d?


Beside this, I am curious to know if it is possible to do the follwoing:

At work, we have Adobe Acrobat installed. We have a task ahead whereby we
will need to get several pdf files and join them into one file. This task
needs repeating many times for different files.

I can select on the files and right click to get the option to join the
files then acrobat launches in and joins them, then I have to save them.

Is it possible to write an macro in excel to read file names, say along
each row and somehow have excel (through the macro) run acrobat, joining
these files together, then saving the result in a directory that will
change name for each conglomeration?

Any help is very much appreciated!

Regards,
Clint



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Help with Macros


Clinton M James Wrote:
Hey all,

I was hoping that somebody out there may be able to help me with some
macro
issues and questions.

First off, I have this line in a macro I have made:

Worksheets("Claim Label Template").PageSetup.PrintArea = "$A$1:$I$26"

this works well, but the problem is in another macro whereby there is
to be
variable amount of lines.

I have a variable that always knows how many lines in the sheet there
are,
and the columns are a constant. Problems is I aways get a run time
error
1004 attempting to make this statement variable. I have tries using
range
cells, but all with the same error. Is there a smiple code liek the one
I
have mentioned that will take, say R for rows, and allow me to set the
print
area to the number of rows up to column d?


Beside this, I am curious to know if it is possible to do the
follwoing:

At work, we have Adobe Acrobat installed. We have a task ahead whereby
we
will need to get several pdf files and join them into one file. This
task
needs repeating many times for different files.

I can select on the files and right click to get the option to join
the
files then acrobat launches in and joins them, then I have to save
them.

Is it possible to write an macro in excel to read file names, say along
each
row and somehow have excel (through the macro) run acrobat, joining
these
files together, then saving the result in a directory that will change
name
for each conglomeration?

Any help is very much appreciated!

Regards,
Clint


I perhaps can suggest solution for the first part. You said that number
of lines can vary and the number is given by variable R then you can
concatenate the string for page setup. Your could write

R = 26 ' variable which has line count
abc = "$A$1:$I$"
abcd = abc & R
Worksheets("Sheet1").PageSetup.PrintArea = abcd

A V Veerkar


--
avveerkar
------------------------------------------------------------------------
avveerkar's Profile: http://www.excelforum.com/member.php...o&userid=30338
View this thread: http://www.excelforum.com/showthread...hreadid=508913

Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
weird saving of a document with macros resulting with macros being transfered to the copy alfonso gonzales Excel Programming 0 December 12th 04 09:19 PM
convert lotus 123w macros to excel macros rpiescik[_2_] Excel Programming 1 September 19th 04 12:41 PM
convert lotus 123w macros to excel macros rpiescik Excel Programming 1 September 18th 04 01:35 PM
Open workbook-macros enabled, opening another with macros George J Excel Programming 5 September 17th 04 02:07 PM
Macros not appearing in the Tools Macro Macros list hglamy[_2_] Excel Programming 5 October 24th 03 09:10 AM


All times are GMT +1. The time now is 05:56 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"