Free Lessons
Courses
Seminars
TechHelp
Fast Tips
Templates
Topic Index
Forum
ABCD
 
Home   Courses   TechHelp   Forums   Help   Contact   Merch   Join   Order   Logon  
 
Back to SendKeys    Comments List
Upload Images   @Reply   Bookmark    Link   Email   Next Unseen 
SendKeys and Excel
Mark Pierce 
     
4 years ago
I am sure someone is already doing this but can the send key operation be used to populate an excel template that is formatted in a certain way? Excel export is easy except when you need to export to a specific formatted form.
Kevin Yip  @Reply  
     
4 years ago
On Excel, it's easier (and better) to use Excel VBA to populate data than using SendKeys in Access.  E.g.:

Cells(2, 3) = "This puts data in C2 on the current worksheet"

I avoid using SendKeys whenever I can.
Mark Pierce OP  @Reply  
     
4 years ago
Thanks Kevin, would you be able to give me an example of the line of code to do that?
Kevin Yip  @Reply  
     
4 years ago
You can use the exact code I used in my example.  In Excel, you can try the code in the immediate window (see pic).  If it works, put in into your procedure.
Kevin Yip  @Reply  
     
4 years ago

Kevin Yip  @Reply  
     
4 years ago
The syntax is Cells(row num, column num).''So:

Cells(2, 1) is A2
Cells(3, 1) is A3
Cells(4, 1) is A4, and so forth.

To refer to the cells with A2, A3, A4, etc., use Range():

Range("A2") or Range("a2")

But the numeral indices used by Cells() allow you to loop though a range of cells with ease:

For i = 1 to 10
     For j = 1 to 100
          Cells(j, i) = j
     Next j
Next i

The above fills A1 to E100 with numbers.

With these methods, you can fill out an Excel sheet in any systematic ways you want.
Richard Rost  @Reply  
          
4 years ago
Mark, I've shown some examples of automating Word from Access, like here: Document Index.

I've got some Excel automation videos coming out soon. For example, you can't use Excel's stock history & pricing functions unless you use Automation.
Mark Pierce OP  @Reply  
     
4 years ago
Great stuff guys!

This thread is now CLOSED. If you wish to comment, start a NEW discussion in SendKeys.
 

Next Unseen

 
New Feature: Comment Live View
 
 

The following is a paid advertisement
Computer Learning Zone is not responsible for any content shown or offers made by these ads.
 

Learn
 
Access - index
Excel - index
Word - index
Windows - index
PowerPoint - index
Photoshop - index
Visual Basic - index
ASP - index
Seminars
More...
Customers
 
Login
My Account
My Courses
Lost Password
Memberships
Student Databases
Change Email
Info
 
Latest News
New Releases
User Forums
Topic Glossary
Tips & Tricks
Search The Site
Code Vault
Collapse Menus
Help
 
Customer Support
Web Site Tour
FAQs
TechHelp
Consulting Services
About
 
Background
Testimonials
Jobs
Affiliate Program
Richard Rost
Free Lessons
Mailing List
PCResale.NET
Order
 
Video Tutorials
Handbooks
Memberships
Learning Connection
Idiot's Guide to Excel
Volume Discounts
Payment Info
Shipping
Terms of Sale
Contact
 
Contact Info
Support Policy
Mailing Address
Phone Number
Fax Number
Course Survey
Email Richard
[email protected]
Blog RSS Feed    YouTube Channel

LinkedIn
Copyright 2026 by Computer Learning Zone, Amicron, and Richard Rost. All Rights Reserved. Current Time: 4/30/2026 11:12:26 AM. PLT: 1s