|
|
macro / script wizzard required
|
|
|
|
Mac Enthusiast
Join Date: May 2000
Location: London U.K.
Status:
Offline
|
|
I have to do this boring copy paste job on my pismo.
These are the three programs I have written but they do not jump to the next line automatically and are not linked
How do l make it so that i only hit the return key and it does my work for me
Sub DoRows()
End Sub
Sub InsertRows3()
'
' InsertRows3 Macro
' Macro recorded 21/6/00 by Mol Gen
'
' Keyboard Shortcut: Option+Cmd+i
'
Selection.EntireRow.Insert
Selection.EntireRow.Insert
Selection.EntireRow.Insert
End Sub
Sub CopyCells()
'
' CopyCells Macro
' Macro recorded 21/6/00 by Mol Gen
'
' Keyboard Shortcut: Option+Cmd+c
'
ActiveCell.Offset(-8, -3).Range("A1 11").Select
ActiveCell.Offset(2, 0).Range("A1").Activate
End Sub
Sub DoRows()
End Sub
Sub InsertRows3()
'
' InsertRows3 Macro
' Macro recorded 21/6/00 by Mol Gen
'
' Keyboard Shortcut: Option+Cmd+i
'
Selection.EntireRow.Insert
Selection.EntireRow.Insert
Selection.EntireRow.Insert
End Sub
Sub CopyCells()
'
' CopyCells Macro
' Macro recorded 21/6/00 by Mol Gen
'
' Keyboard Shortcut: Option+Cmd+c
'
ActiveCell.Offset(-8, -3).Range("A1 11").Select
ActiveCell.Offset(2, 0).Range("A1").Activate
End Sub
Sub DoRows()
End Sub
Sub InsertRows3()
'
' InsertRows3 Macro
' Macro recorded 21/6/00 by Mol Gen
'
' Keyboard Shortcut: Option+Cmd+i
'
Selection.EntireRow.Insert
Selection.EntireRow.Insert
Selection.EntireRow.Insert
End Sub
Sub CopyCells()
'
' CopyCells Macro
' Macro recorded 21/6/00 by Mol Gen
'
' Keyboard Shortcut: Option+Cmd+c
'
ActiveCell.Offset(-8, -3).Range("A1 11").Select
ActiveCell.Offset(2, 0).Range("A1").Activate
End Sub
|
|
|
|
|
|
|
|
|
Junior Member
Join Date: Oct 1999
Location: Edmonton, Alberta, Canada
Status:
Offline
|
|
|
-- An idea is salvation by imagination.
-- Frank Lloyd Wright
-- 30 --
|
|
|
|
|
|
|
|
Dedicated MacNNer
Join Date: Nov 1999
Location: Georgetown, Demerara, Guyana
Status:
Offline
|
|
Hi all,
The subroutines look like they were written in MS' cross-platform VBA language (or the VBScript subset), which is available within most MS Office apps, etc...
qnc, I'm a little confused about what you want to do. The three groups of subroutines that you posted all seem to be identical to each other, and I don't see any actual copy/paste commands such as 'Selection.Copy' & 'ActiveSheet.Paste' or direct assignment ['=']... Also, within each group, the "main" 'DoRows()' routine doesn't call either of the other two subroutines ['InsertRows3()' or 'CopyCells()']. I guess that you've been manually triggering the latter two subroutines via the indicated hot-keys. Do you want these subroutines to now be invoked from within 'DoRows()', and/or to use the Return key as a hot-key for 'DoRows()'? And, when you say "jump to the next line", do you mean you'd like to perform something other than an explicit 'ActiveCell.Offset(<n>, 0).Select' command after the cell-range is copied?
BTW, for general VBA tips (beyond MS Office's built-in Help), you could try exploring the resources mentioned in the VBScript portion of MS' official Windows Script Technologies sub-site, or MS's official Visual Basic for Applications home page, or the independent OfficeVBA.com web site. There are also various discussion archives and help sites such as:- MailBase UK's 'excel-vb-discuss' Mailing List Archive and 'office-vba-discuss' Mailing List Archive; ZDNet�s general Microsoft VBA Help sub-site and Office Forum; and, PCWorld's Spreadsheet Tips (e.g., the Sep 1997 issue includes an example copy/paste macro). In addition, there are various official MS VBA books available from BookPool and other sources, such as Microsoft Office 97/Visual Basic Programmer's Guide. All of these resources are pretty much Windows-oriented, but most of the info that's related to the language itself should also be relevant to Mac OS.
Regards,
--Paul
[This message has been edited by Paul Crawford (edited 06-25-2000).]
|
|
|
|
|
|
|
|
|
Mac Enthusiast
Join Date: May 2000
Location: London U.K.
Status:
Offline
|
|
Well I would like three rows from an excel spread sheet copied into another genotpying program yes these are triggered by hotkeys and yes I would like them all to do it efficiently and with one key like a proper command structure moving down the coloums and copyting the information into the other application is this possible
P.S. this is my first attempt at this kind of Marco programing so consider this when giving me instructions
Thanks
|
|
|
|
|
|
|
|
|
Dedicated MacNNer
Join Date: Nov 1999
Location: Georgetown, Demerara, Guyana
Status:
Offline
|
|
Hi qnc,
I hope that you've already found your answer elsewhere [my VBA skills are a bit rusty, to say the least :-)]. However, since Excel is also "AppleScript-able" (& -recordable, I believe), it seems as though AppleScript might be the way to go here, rather than VBA. For example, if the target genotyping program is not VBA-aware but is AppleScript-able, then you could probably use the Script Editor's built-in recording facility to capture the entire process, all the way from Excel through to the target program (the resulting script may need a few tweaks for relative references, but hopefully not too many).
On the other hand, even if the target program is not AppleScript-able, you might still be able to use AppleScript to paste the copied data into it -- with the help of any one of several third-party freeware Scripting Additions ("OSAXen") that can simulate typing the standard 'Cmd-V' shortcut.
In any event, if you'd like to try using AppleScript instead, feel free to experiment with Script Editor:- hit that 'Record' button, switch to Excel, copy three rows, switch to the target program, paste the data, and then switch back to Script Editor to see what commands were recorded. AppleScript's syntax is much more "natural-language" than VBA's, and you could also try using the Script Editor's 'File | Open Dictionary...' menu-item to open up Excel and the target program to see the full list of AppleScript commands that they understand (including cell/range navigation commands for Excel).
Otherwise, if you'd like to continue using VBA, and you are unable to obtain more expert assistance through the various VBA resources that I mentioned above, please let us know, and either I or someone else will try our best to help you further.
Regards,
--Paul
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Forum Rules
|
|
|
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
|
HTML code is Off
|
|
|
|
|
|
|
|
|
|
|
|