Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 24
Default Why does this simple thing not work?

Hi,

This is a very simple thing, so i tought, but it just keeps giving an error.

Private Sub CommandButton1_Click()
'BUTTON SAVE
ActiveSheet.Range("M5").Copy
Worksheets("Historiek").Select
Range("D3").Paste
End Sub

Can anyone tell me why or what it is i'm doing wrong?

Regards,
Peter


  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3,290
Default Why does this simple thing not work?

Peter,
Additional information could help to answer your question...
What version of Excel are you using?
What is the error number and text?
On what code line does the error occur?
Is the Command button on a Worksheet, Chart or a UserForm?

Making a swag, try setting the "Take Focus on Click" property of
the command button to False.
Jim Cone
San Francisco, USA


"Peter"
wrote in message

Hi,
This is a very simple thing, so i tought, but it just keeps giving an error.

Private Sub CommandButton1_Click()
'BUTTON SAVE
ActiveSheet.Range("M5").Copy
Worksheets("Historiek").Select
Range("D3").Paste
End Sub

Can anyone tell me why or what it is i'm doing wrong?
Regards,
Peter


  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 52
Default Why does this simple thing not work?

"Peter" wrote in message
...
Hi,

This is a very simple thing, so i tought, but it just keeps giving an
error.

Private Sub CommandButton1_Click()
'BUTTON SAVE
ActiveSheet.Range("M5").Copy
Worksheets("Historiek").Select
Range("D3").Paste
End Sub

Can anyone tell me why or what it is i'm doing wrong?

Regards,
Peter


Activate auto-record a macro to see the correct
sintax:

Range("M5").Select
Selection.Copy
Sheets("Historiek").Select
Range("D3").Select
ActiveSheet.Paste




  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 24
Default Why does this simple thing not work?

Thx for all your help guys, everything works now.
You're great ;-)

Greets,
Peter
"john" schreef in bericht
...
On Thu, 22 Sep 2005 14:57:32 GMT, "Peter" wrote:

Hi,

This is a very simple thing, so i tought, but it just keeps giving an
error.

Private Sub CommandButton1_Click()
'BUTTON SAVE
ActiveSheet.Range("M5").Copy
Worksheets("Historiek").Select
Range("D3").Paste
End Sub

Can anyone tell me why or what it is i'm doing wrong?

Regards,
Peter



change

Range("D3").Paste

to

Range("D3").select
activesheet.Paste


Or, just do this


Range("M5").Copy Sheets("Historiek").Range("D3")

and it'll paste it to D3 on Historiek

john



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
So simple, but I can't get it to work hmsawyer Excel Discussion (Misc queries) 4 April 5th 08 07:58 AM
simple deletion won't work for me jgriffs Excel Discussion (Misc queries) 2 January 29th 06 09:55 PM
Simple but I can't get it to work? PLEASE help!! Naji Excel Discussion (Misc queries) 6 January 11th 06 10:27 PM
Simple Thing Brian Excel Programming 2 December 10th 04 08:41 PM
Why this simple macro doesn't work? 71marco71[_8_] Excel Programming 2 February 6th 04 06:53 PM


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