Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 4
Default commandbutton?

I am entering info into Excel Sheet1 A1, B1, C1, D1. I want to click a
button (Submit) to move info to Sheet2 A1, B1, C1, D1. After I click button
I would like Sheet1 to be ready for new entries which when Submit is clicked
again will be moved to next rows on Sheet2 (A2, B2, C2,D2).

thanks
Bobby

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3,986
Default commandbutton?

Try this. It goes in the CommandButton code module, naturally.



"Bobbykm" wrote:

I am entering info into Excel Sheet1 A1, B1, C1, D1. I want to click a
button (Submit) to move info to Sheet2 A1, B1, C1, D1. After I click button
I would like Sheet1 to be ready for new entries which when Submit is clicked
again will be moved to next rows on Sheet2 (A2, B2, C2,D2).

thanks
Bobby

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3,986
Default commandbutton?

I hit the post button too quick.

Sub CommandButton1_Click()
lr2 = Worksheets("Sheet2").Cells(Rows.Count, 1).End(xlUp).Row
Worksheets("Sheet1").Range("A1:D").Cut Worksheets("Sheet2").Range("A" & lr)
CutCopyMode = False
End Sub

"Bobbykm" wrote:

I am entering info into Excel Sheet1 A1, B1, C1, D1. I want to click a
button (Submit) to move info to Sheet2 A1, B1, C1, D1. After I click button
I would like Sheet1 to be ready for new entries which when Submit is clicked
again will be moved to next rows on Sheet2 (A2, B2, C2,D2).

thanks
Bobby

  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3,942
Default commandbutton?

hi,
another way, without using cut and paste.
Private Sub cb1_Click()
Dim fr As Range
Dim sr As Range
Set sr = Sheet2.Range("A65536").End(xlUp).Offset(1, 0)
Set fr = Range("A65536").End(xlUp)
sr.Value = fr.Value
sr.Offset(0, 1).Value = fr.Offset(0, 1).Value
sr.Offset(0, 2).Value = fr.Offset(0, 2).Value
sr.Offset(0, 3).Value = fr.Offset(0, 3).Value

End Sub
regards
FSt1

"Bobbykm" wrote:

I am entering info into Excel Sheet1 A1, B1, C1, D1. I want to click a
button (Submit) to move info to Sheet2 A1, B1, C1, D1. After I click button
I would like Sheet1 to be ready for new entries which when Submit is clicked
again will be moved to next rows on Sheet2 (A2, B2, C2,D2).

thanks
Bobby

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
Commandbutton alvin Kuiper Excel Programming 6 November 27th 05 06:28 PM
CommandButton Alvin Hansen[_2_] Excel Programming 3 August 16th 04 06:35 PM
CommandButton chris[_12_] Excel Programming 1 April 15th 04 01:01 AM
CommandButton rwebster3 Excel Programming 0 April 14th 04 08:16 PM
Commandbutton David Fixemer Excel Programming 2 February 25th 04 10:18 PM


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