PC Review


Reply
Thread Tools Rate Thread

Code string for button

 
 
Newbeetle
Guest
Posts: n/a
 
      11th Jul 2008
Hi,

I have a command button called “Compare” and I would like it to do the
following when pressed;

1) Compare the date in cell h2 on sheet1 to today's date, if the date is
older than today’s date, copy data in cells h7:h12 to j7-j12 on sheet2.
2) I would then like the date in cell h2 on sheet1 to change to today’s date.

Thanks for any help with this,

Newbeetle
--
This post was created using recycled electrons!
 
Reply With Quote
 
 
 
 
FSt1
Guest
Posts: n/a
 
      11th Jul 2008
hi
Private Sub CommandButton1_Click()
If Sheets("sheet1").Range("H2").Value < Date Then
Sheets("sheet1").Range("H7:H12").Copy _
Destination:=Sheets("sheet2").Range("J7:J12")
Sheets("sheet1").Range("H2").Value = Date
Else
MsgBox "no go"
Exit Sub
End If
End Sub

regards
FSt1

"Newbeetle" wrote:

> Hi,
>
> I have a command button called “Compare” and I would like it to do the
> following when pressed;
>
> 1) Compare the date in cell h2 on sheet1 to today's date, if the date is
> older than today’s date, copy data in cells h7:h12 to j7-j12 on sheet2.
> 2) I would then like the date in cell h2 on sheet1 to change to today’s date.
>
> Thanks for any help with this,
>
> Newbeetle
> --
> This post was created using recycled electrons!

 
Reply With Quote
 
Newbeetle
Guest
Posts: n/a
 
      11th Jul 2008
Wow that was quick, thankyou so much.

Have a good weekend.

Regards
Newbeetle
--
This post was created using recycled electrons!


"FSt1" wrote:

> hi
> Private Sub CommandButton1_Click()
> If Sheets("sheet1").Range("H2").Value < Date Then
> Sheets("sheet1").Range("H7:H12").Copy _
> Destination:=Sheets("sheet2").Range("J7:J12")
> Sheets("sheet1").Range("H2").Value = Date
> Else
> MsgBox "no go"
> Exit Sub
> End If
> End Sub
>
> regards
> FSt1
>
> "Newbeetle" wrote:
>
> > Hi,
> >
> > I have a command button called “Compare” and I would like it to do the
> > following when pressed;
> >
> > 1) Compare the date in cell h2 on sheet1 to today's date, if the date is
> > older than today’s date, copy data in cells h7:h12 to j7-j12 on sheet2.
> > 2) I would then like the date in cell h2 on sheet1 to change to today’s date.
> >
> > Thanks for any help with this,
> >
> > Newbeetle
> > --
> > This post was created using recycled electrons!

 
Reply With Quote
 
FSt1
Guest
Posts: n/a
 
      11th Jul 2008
thanks for the feedback
regards
FSt1

"Newbeetle" wrote:

> Wow that was quick, thankyou so much.
>
> Have a good weekend.
>
> Regards
> Newbeetle
> --
> This post was created using recycled electrons!
>
>
> "FSt1" wrote:
>
> > hi
> > Private Sub CommandButton1_Click()
> > If Sheets("sheet1").Range("H2").Value < Date Then
> > Sheets("sheet1").Range("H7:H12").Copy _
> > Destination:=Sheets("sheet2").Range("J7:J12")
> > Sheets("sheet1").Range("H2").Value = Date
> > Else
> > MsgBox "no go"
> > Exit Sub
> > End If
> > End Sub
> >
> > regards
> > FSt1
> >
> > "Newbeetle" wrote:
> >
> > > Hi,
> > >
> > > I have a command button called “Compare” and I would like it to do the
> > > following when pressed;
> > >
> > > 1) Compare the date in cell h2 on sheet1 to today's date, if the date is
> > > older than today’s date, copy data in cells h7:h12 to j7-j12 on sheet2.
> > > 2) I would then like the date in cell h2 on sheet1 to change to today’s date.
> > >
> > > Thanks for any help with this,
> > >
> > > Newbeetle
> > > --
> > > This post was created using recycled electrons!

 
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
Re: Button calling aother button's code Rich P Microsoft VB .NET 1 15th Apr 2010 05:17 PM
Re: Button calling aother button's code Patrice Microsoft VB .NET 0 15th Apr 2010 05:07 PM
Re: Button calling aother button's code Armin Zingler Microsoft VB .NET 0 15th Apr 2010 04:39 PM
Re: Button calling aother button's code Mr. Arnold Microsoft VB .NET 0 15th Apr 2010 04:20 PM
How to assign same code inside Option button code space ?? furbiuzzu Microsoft Excel Programming 1 21st Nov 2006 02:36 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 01:26 AM.