Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 184
Default ExcelVBA Paste record In next empty next Row

If I understand you, each time the macro is run you want it to place
the data in the next empty row--then use the following:

Public Sub PasteData()
Dim PCount As Integer

Cells(1, 2).Select

PCount = ActiveSheet.Cells(Rows.Count, "A").End(xlUp).Row + 1

Cells(PCount, 1).Value = "Par1"
Cells(PCount, 2).Value = "Par2"
Cells(PCount, 3).Value = "Par3"
Cells(PCount, 4).Value = "Par4"
Cells(PCount, 5).Value = "Par5"

End Sub


The scope/lifetime of your variable 'PCount' lasts only as long as the
procedure is running, once the procedure is finished the variable
PCount ceases to exist.

HTH--Lonnie M.

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
Delete record if cell is empty Metrazal[_2_] Excel Programming 3 February 21st 06 09:43 PM
Copy and paste from last record at bottom of column [email protected] New Users to Excel 0 February 7th 06 10:25 PM
ExcelVBA (Search/Filter/Copy) magix Excel Discussion (Misc queries) 7 December 11th 05 02:45 PM
how to direct users to the empty row below the last record in excel shirley Excel Programming 10 March 3rd 04 10:53 PM
Warn for an Empty Record Soniya Excel Programming 5 August 13th 03 03:02 PM


All times are GMT +1. The time now is 01:16 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"