Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Coping values to the next empty row

I need code that will paste two separate values in one
worksheet in the next available row. One value in
column "A" and the other value in column "B". The code
would paste the values as the user shuts down the program
in the same row of a specified worksheet. I need this to
collect a series of values from separate users who use
this program at different times of the day.

Thanks in advance,
Rich
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 90
Default Coping values to the next empty row

I assume that you have no problems coping but wish this:

The following pair would add values to the row beneath the bottom of the
sheet. If you want to put it somewhere higher, that will depend on the
design of your application, likely involving xlDown or such.

dim lLastRow as long
lLastRow = ActiveCell.SpecialCells(xlLastCell).Row
Range("A1").Offset(lLastRow, 0)="1st"
Range("A1").Offset(lLastRow, 1)="2nd"

Some considerations, best investigated by typing Control-End on your
sheet:
when sheet already extends to row 65536
when sheet has had rows deleted, so that the bottom of the sheet is
artificially "low"
when sheet has cells with formats but no values, so that the bottom is
artificially "low"
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
empty values for a specific field avi Excel Discussion (Misc queries) 0 December 10th 07 10:09 AM
Defauls Values In Empty Cells chrysler265 New Users to Excel 1 February 16th 07 03:10 PM
How to select cells with values only (not empty ones)? nick Excel Discussion (Misc queries) 4 December 20th 06 09:07 PM
Empty Chart Values [email protected] Excel Worksheet Functions 0 September 3rd 06 05:31 AM
Coping Values - Not the cell Tim[_14_] Excel Programming 3 August 7th 03 04:02 PM


All times are GMT +1. The time now is 07:17 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"