PC Review


Reply
Thread Tools Rate Thread

commandbutton?

 
 
=?Utf-8?B?Qm9iYnlrbQ==?=
Guest
Posts: n/a
 
      30th Sep 2007
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 With Quote
 
 
 
 
=?Utf-8?B?SkxHV2hpeg==?=
Guest
Posts: n/a
 
      30th Sep 2007
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
>

 
Reply With Quote
 
=?Utf-8?B?SkxHV2hpeg==?=
Guest
Posts: n/a
 
      30th Sep 2007
I hit the post button too quick.

Sub CommandButton1_Click()
lr2 = Worksheets("Sheet2").Cells(Rows.Count, 1).End(xlUp).Row
Worksheets("Sheet1").Range("A1").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
>

 
Reply With Quote
 
=?Utf-8?B?RlN0MQ==?=
Guest
Posts: n/a
 
      30th Sep 2007
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 With Quote
 
 
 
Reply

Thread Tools
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

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
how to get commandbutton name =?Utf-8?B?U2Vhbg==?= Microsoft Excel Programming 2 17th Oct 2006 08:49 AM
commandbutton =?Utf-8?B?Z2lhbg==?= Microsoft Excel Misc 1 11th Oct 2004 09:30 PM
CommandButton Simon Microsoft Outlook VBA Programming 3 13th Sep 2004 03:35 PM
Commandbutton Sadik Microsoft Excel Programming 1 12th Mar 2004 07:07 PM
Commandbutton David Fixemer Microsoft Excel Programming 2 25th Feb 2004 10:18 PM


Features
 

Advertising
 

Newsgroups
 


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