LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
Sam Sam is offline
external usenet poster
 
Posts: 699
Default inserting data in next row on clicking a button

Hi All,

How can I loop through excel rows by clicking a button. I want to populate a
new row in excel every time I click this button.

For eg: I Click a button "Insert" , on clicking this button I want to insert
data in next empty row. Once user inputs data on Sheet1 and clicks insert, it
inserts the data in sheet2 and clears the data in sheet1, Now user can again
input data in sheet1 and clicking insert will insert data in row 2 of sheet2
(Basically next available row).

Is there a way to loop it like this? and keep updating the sheet with data
in next row?
Here is the part of code for looping through new rows. But it doesnt work as
I want it to.


Dim r as long

Set wst = Worksheets("sheet1")

With wst
..Range("A1").Value = Me.City.Value

End With

r = r + 1

FName = "C:\My Documents\" _
& "Address" & ".xls"

wst.SaveAs FileName:=FName

Hope I made it clear.

Thanks in Advance


 
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
Inserting a picture object and double-clicking on it opens photo e Kay Excel Discussion (Misc queries) 4 August 12th 08 03:09 AM
Passing parameters from clicking a button Jay worley Excel Programming 1 April 16th 08 03:35 PM
Get info on toolbar button by clicking on it Spamarrant Excel Programming 0 August 25th 06 01:33 PM
Store data JUST entered in Activecell after clicking command button on worksheet [email protected] Excel Programming 1 August 23rd 06 04:20 AM


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