Visual Basic Programming
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
 
 
User Name:
Password:
Remember me
Iron Speed
Go Back   ASP Free ForumsProgrammingVisual Basic Programming

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread ASP Free Forums Sponsor:
SlickEdit: Code in over 40 languages across 7 platforms. SlickEdit’s unmatched power, speed, and flexibility allows even the most accomplished developers to write better code faster. Download a free trial today!
  #1  
Old April 16th, 2004, 08:15 AM
Cresosote65 Cresosote65 is offline
Registered User
ASP Free Newbie (0 - 499 posts)
 
Join Date: Mar 2004
Location: Montreal, CANADUH
Posts: 8 Cresosote65 User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Unhappy Problem with macro recorder in Excel 2002

Hi All,


I'm sure that this question has beeen asked many times before me, but I need to know this in a very immediate way. I have recorded a macro in Excel (2002) that works perfectly well. That is, it works for the file that I used to create it with. At one point in the macro, I navigate to the last line of data, copy the selection, and paste it to the first blank line. The script looks like this:

Selection.End(xlDown).Select
Range(Selection, Selection.End(xlToRight)).Select
Selection.Copy
Range("A24").Select
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
:=False, Transpose:=False

The problem is the Range("A24").Select part. I would want the script to be something that will adapt to the possibility that next time I might have 50 lines instead of 23 data lines, or 10, or 157... I want to record how I got to my cell, not the cell itself. Is there a listing somewhere of the keystroke commands? Any help will be greatly appreciated.

Creo

Reply With Quote
  #2  
Old April 16th, 2004, 03:59 PM
sbaxter sbaxter is offline
Moderator: Access, SQL
ASP Free God (5000 - 5499 posts)
 
Join Date: Oct 2003
Posts: 5,126 sbaxter User rank is Corporal (100 - 500 Reputation Level)sbaxter User rank is Corporal (100 - 500 Reputation Level)sbaxter User rank is Corporal (100 - 500 Reputation Level)sbaxter User rank is Corporal (100 - 500 Reputation Level) 
Time spent in forums: 4 Days 1 h 2 m 51 sec
Reputation Power: 12
What you will need to do is start at the top of you page. Move down one row at a time and loop through untill you find an empty cell. Then you past you data and life is good.

S-

Reply With Quote
Reply

Viewing: ASP Free ForumsProgrammingVisual Basic Programming > Problem with macro recorder in Excel 2002


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 

Iron Speed




© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 5 hosted by Hostway