Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 98
Default Code string for button

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 todays 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 todays date.

Thanks for any help with this,

Newbeetle
--
This post was created using recycled electrons!
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3,942
Default Code string for button

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 todays 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 todays date.

Thanks for any help with this,

Newbeetle
--
This post was created using recycled electrons!

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 98
Default Code string for button

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 todays 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 todays date.

Thanks for any help with this,

Newbeetle
--
This post was created using recycled electrons!

  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3,942
Default Code string for button

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 todays 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 todays date.

Thanks for any help with this,

Newbeetle
--
This post was created using recycled electrons!

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
string contra VBA code [email protected] Excel Worksheet Functions 8 July 14th 09 01:48 AM
How to assign same code inside Option button code space ?? furbiuzzu Excel Programming 1 November 21st 06 02:36 PM
How to make a button VBA code reference other VBA code subroutines??? gunman[_9_] Excel Programming 4 September 27th 05 01:01 AM
String to code Factivator Excel Programming 2 March 11th 05 01:03 PM
Select option button when have the name as a string Debbie Probert via OfficeKB.com Excel Programming 2 January 18th 05 04:37 PM


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

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"