Macros or converting Lotus 123 Macros to Excel

B

Bruce

I am trying to convert several existing Lotus 123 macros
and/or create a new macro in Excel. This is some old work
I did several years ago that I am leveraging.

The macro needs to copy the row where the cursor is
positioned on the spreadsheet to a common row that is used
to populate and print a Claim Form.
Here is a macro I used in Lotus 123 a few years ago.

/c{r 50}~printarea~
{GOTO}CLAIMNO~{?}{R}~{CALC}
/ppr{claim}~agq

What this macro does is: you select the row (claim) to be
printed. When you initiate the macro it copies the 50
adjacent columns in the row and copies it into to Range
called "Printarea" (which is a common area that populates
a form). It is then Calculated (F9) and the claim printed
to the printer. Manual calculation is on........

Here is the Excel macro that I created but it only works
for a specific line # - I can't figure out how to copy
generically the 50 columns in the row. The rest of the
macro works.

See the statement in the macro below <<<<<-------

Sub PrintClaim()
'
' PrintClaim Macro
' Macro recorded 05/13/2004 by Bruce '
' Keyboard Shortcut: Ctrl+Shift+P
'
Range("B95:BB95").Select <<<<-------------
Selection.Copy
Range("B83").Select
ActiveSheet.Paste
Application.Goto Reference:="CLAIMNO"
Application.CutCopyMode = False
Calculate
ActiveWindow.SelectedSheets.PrintOut Copies:=1,
Collate:=True
End Sub

Thanks for your assistance

Bruce
 
T

Trevor Shuttleworth

Bruce

one way:

Sub PrintClaim()
'
' PrintClaim Macro
' Macro recorded 05/13/2004 by Bruce '
' Keyboard Shortcut: Ctrl+Shift+P
'
Range("B" & ActiveCell.Row & _
":BB" & ActiveCell.Row).Copy _
Range("B83")
'Application.Goto Reference:="CLAIMNO"
'Application.CutCopyMode = False
Calculate
' ActiveWindow.SelectedSheets.PrintOut Copies:=1, Collate:=True
End Sub

Regards

Trevor
 
D

Don Guillett

IF you said you wanted to copy the cell and 50 cells to the right to
printarea and print. IF so, this assumes that the cell desired it NAMED
claimo and it copies those columns to another cell named printarea and
prints. If you want the active cell, just change the comment.

Sub doprint()
'ActiveCell.Resize(1, 5).Copy Range("printarea")
Range("claimo").Resize(1, 5).Copy Range("printarea")
Calculate
ActiveSheet.PrintOut
end sub
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top