Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 83
Default Macro Button in a work sheet

Hello people,

How can i put a button into my worsheet,and attach a macro to it. so that
the button is only relevant to that w/sheet. I know how to drag a button on
the Toolbar from the Forms toolbar and attach a macro,but the same process
doesn't appear to work for my problem.

What I actually want to do is press this button which will then clear down
designated cells prior to use.

I am using Excel 2004

All offers of help gratefully accepted
FG

  #2   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 83
Default Macro Button in a work sheet

Oops - of course its Excel 2003

"Finance Guru" wrote:

Hello people,

How can i put a button into my worsheet,and attach a macro to it. so that
the button is only relevant to that w/sheet. I know how to drag a button on
the Toolbar from the Forms toolbar and attach a macro,but the same process
doesn't appear to work for my problem.

What I actually want to do is press this button which will then clear down
designated cells prior to use.

I am using Excel 2004

All offers of help gratefully accepted
FG

  #3   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 35,218
Default Macro Button in a work sheet

You can write your code so that you're only using the active sheet.

Option Explicit
Sub testme()
with activesheet
msgbox .name 'just to verify
.range("b9,c22,e3:g9,h:h,w:x").clearcontents
end with
end sub

Finance Guru wrote:

Hello people,

How can i put a button into my worsheet,and attach a macro to it. so that
the button is only relevant to that w/sheet. I know how to drag a button on
the Toolbar from the Forms toolbar and attach a macro,but the same process
doesn't appear to work for my problem.

What I actually want to do is press this button which will then clear down
designated cells prior to use.

I am using Excel 2004

All offers of help gratefully accepted
FG


--

Dave Peterson
  #4   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 83
Default Macro Button in a work sheet

Hello Dave - Thanks for that,but what I really want is the button within the
worksheet,as the user(s) will not always know how to run a macro,hence the
requirement for the button to allow the user to click on,and let the macro
behind it do all the work.


"Dave Peterson" wrote:

You can write your code so that you're only using the active sheet.

Option Explicit
Sub testme()
with activesheet
msgbox .name 'just to verify
.range("b9,c22,e3:g9,h:h,w:x").clearcontents
end with
end sub

Finance Guru wrote:

Hello people,

How can i put a button into my worsheet,and attach a macro to it. so that
the button is only relevant to that w/sheet. I know how to drag a button on
the Toolbar from the Forms toolbar and attach a macro,but the same process
doesn't appear to work for my problem.

What I actually want to do is press this button which will then clear down
designated cells prior to use.

I am using Excel 2004

All offers of help gratefully accepted
FG


--

Dave Peterson

  #5   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 35,218
Default Macro Button in a work sheet

I don't understand. This is the macro that would be assigned to any button from
the forms toolbar on any worksheet.

It'll clear the contents of the specified range when the user clicks on that
button.

Finance Guru wrote:

Hello Dave - Thanks for that,but what I really want is the button within the
worksheet,as the user(s) will not always know how to run a macro,hence the
requirement for the button to allow the user to click on,and let the macro
behind it do all the work.

"Dave Peterson" wrote:

You can write your code so that you're only using the active sheet.

Option Explicit
Sub testme()
with activesheet
msgbox .name 'just to verify
.range("b9,c22,e3:g9,h:h,w:x").clearcontents
end with
end sub

Finance Guru wrote:

Hello people,

How can i put a button into my worsheet,and attach a macro to it. so that
the button is only relevant to that w/sheet. I know how to drag a button on
the Toolbar from the Forms toolbar and attach a macro,but the same process
doesn't appear to work for my problem.

What I actually want to do is press this button which will then clear down
designated cells prior to use.

I am using Excel 2004

All offers of help gratefully accepted
FG


--

Dave Peterson


--

Dave Peterson


  #6   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 83
Default Macro Button in a work sheet

What I am attempting to is :

ToolsCustomiseFormsButton. Then drag a Button icon up onto the worksheet
and place it somewhere around cell E4.( Im not really bothered exactly where
),but E4 sounds a good a place as any. It want to drag the button on to the
worsheet,bu using the above, will only allow me to drag the button up on to
another toolbar,Which is what I don't want). I have seen this done
previoualy,but i have forgotten,where and how.

hth
FG


"Dave Peterson" wrote:

I don't understand. This is the macro that would be assigned to any button from
the forms toolbar on any worksheet.

It'll clear the contents of the specified range when the user clicks on that
button.

Finance Guru wrote:

Hello Dave - Thanks for that,but what I really want is the button within the
worksheet,as the user(s) will not always know how to run a macro,hence the
requirement for the button to allow the user to click on,and let the macro
behind it do all the work.

"Dave Peterson" wrote:

You can write your code so that you're only using the active sheet.

Option Explicit
Sub testme()
with activesheet
msgbox .name 'just to verify
.range("b9,c22,e3:g9,h:h,w:x").clearcontents
end with
end sub

Finance Guru wrote:

Hello people,

How can i put a button into my worsheet,and attach a macro to it. so that
the button is only relevant to that w/sheet. I know how to drag a button on
the Toolbar from the Forms toolbar and attach a macro,but the same process
doesn't appear to work for my problem.

What I actually want to do is press this button which will then clear down
designated cells prior to use.

I am using Excel 2004

All offers of help gratefully accepted
FG

--

Dave Peterson


--

Dave Peterson

  #7   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 22,906
Default Macro Button in a work sheet

Try ViewToolbarsForms.

Click on the button icon and draw a button wherever you wish.

Assign the macro to that button.


Gord Dibben MS Excel MVP

On Thu, 15 Nov 2007 06:14:04 -0800, Finance Guru
wrote:

What I am attempting to is :

ToolsCustomiseFormsButton. Then drag a Button icon up onto the worksheet
and place it somewhere around cell E4.( Im not really bothered exactly where
),but E4 sounds a good a place as any. It want to drag the button on to the
worsheet,bu using the above, will only allow me to drag the button up on to
another toolbar,Which is what I don't want). I have seen this done
previoualy,but i have forgotten,where and how.

hth
FG


"Dave Peterson" wrote:

I don't understand. This is the macro that would be assigned to any button from
the forms toolbar on any worksheet.

It'll clear the contents of the specified range when the user clicks on that
button.

Finance Guru wrote:

Hello Dave - Thanks for that,but what I really want is the button within the
worksheet,as the user(s) will not always know how to run a macro,hence the
requirement for the button to allow the user to click on,and let the macro
behind it do all the work.

"Dave Peterson" wrote:

You can write your code so that you're only using the active sheet.

Option Explicit
Sub testme()
with activesheet
msgbox .name 'just to verify
.range("b9,c22,e3:g9,h:h,w:x").clearcontents
end with
end sub

Finance Guru wrote:

Hello people,

How can i put a button into my worsheet,and attach a macro to it. so that
the button is only relevant to that w/sheet. I know how to drag a button on
the Toolbar from the Forms toolbar and attach a macro,but the same process
doesn't appear to work for my problem.

What I actually want to do is press this button which will then clear down
designated cells prior to use.

I am using Excel 2004

All offers of help gratefully accepted
FG

--

Dave Peterson


--

Dave Peterson


  #8   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 83
Default Macro Button in a work sheet

Hi Gord - I will try this. but just as an update I have manged to copy
something similar from another worksheet. I have attached the macro statement
that I require to clear down the cells

Thanks again
FG
"Gord Dibben" wrote:

Try ViewToolbarsForms.

Click on the button icon and draw a button wherever you wish.

Assign the macro to that button.


Gord Dibben MS Excel MVP

On Thu, 15 Nov 2007 06:14:04 -0800, Finance Guru
wrote:

What I am attempting to is :

ToolsCustomiseFormsButton. Then drag a Button icon up onto the worksheet
and place it somewhere around cell E4.( Im not really bothered exactly where
),but E4 sounds a good a place as any. It want to drag the button on to the
worsheet,bu using the above, will only allow me to drag the button up on to
another toolbar,Which is what I don't want). I have seen this done
previoualy,but i have forgotten,where and how.

hth
FG


"Dave Peterson" wrote:

I don't understand. This is the macro that would be assigned to any button from
the forms toolbar on any worksheet.

It'll clear the contents of the specified range when the user clicks on that
button.

Finance Guru wrote:

Hello Dave - Thanks for that,but what I really want is the button within the
worksheet,as the user(s) will not always know how to run a macro,hence the
requirement for the button to allow the user to click on,and let the macro
behind it do all the work.

"Dave Peterson" wrote:

You can write your code so that you're only using the active sheet.

Option Explicit
Sub testme()
with activesheet
msgbox .name 'just to verify
.range("b9,c22,e3:g9,h:h,w:x").clearcontents
end with
end sub

Finance Guru wrote:

Hello people,

How can i put a button into my worsheet,and attach a macro to it. so that
the button is only relevant to that w/sheet. I know how to drag a button on
the Toolbar from the Forms toolbar and attach a macro,but the same process
doesn't appear to work for my problem.

What I actually want to do is press this button which will then clear down
designated cells prior to use.

I am using Excel 2004

All offers of help gratefully accepted
FG

--

Dave Peterson


--

Dave Peterson



  #9   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 83
Default Macro Button in a work sheet

Gord - just an update for you. I see what you mean,although it took me couple
of minutes to figure it all out, dooooooooooooooooooooo. Now i understand how
it's done it's easy

You are the main man!
Thanks a lot
FG


"Gord Dibben" wrote:

Try ViewToolbarsForms.

Click on the button icon and draw a button wherever you wish.

Assign the macro to that button.


Gord Dibben MS Excel MVP

On Thu, 15 Nov 2007 06:14:04 -0800, Finance Guru
wrote:

What I am attempting to is :

ToolsCustomiseFormsButton. Then drag a Button icon up onto the worksheet
and place it somewhere around cell E4.( Im not really bothered exactly where
),but E4 sounds a good a place as any. It want to drag the button on to the
worsheet,bu using the above, will only allow me to drag the button up on to
another toolbar,Which is what I don't want). I have seen this done
previoualy,but i have forgotten,where and how.

hth
FG


"Dave Peterson" wrote:

I don't understand. This is the macro that would be assigned to any button from
the forms toolbar on any worksheet.

It'll clear the contents of the specified range when the user clicks on that
button.

Finance Guru wrote:

Hello Dave - Thanks for that,but what I really want is the button within the
worksheet,as the user(s) will not always know how to run a macro,hence the
requirement for the button to allow the user to click on,and let the macro
behind it do all the work.

"Dave Peterson" wrote:

You can write your code so that you're only using the active sheet.

Option Explicit
Sub testme()
with activesheet
msgbox .name 'just to verify
.range("b9,c22,e3:g9,h:h,w:x").clearcontents
end with
end sub

Finance Guru wrote:

Hello people,

How can i put a button into my worsheet,and attach a macro to it. so that
the button is only relevant to that w/sheet. I know how to drag a button on
the Toolbar from the Forms toolbar and attach a macro,but the same process
doesn't appear to work for my problem.

What I actually want to do is press this button which will then clear down
designated cells prior to use.

I am using Excel 2004

All offers of help gratefully accepted
FG

--

Dave Peterson


--

Dave Peterson



  #10   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 22,906
Default Macro Button in a work sheet

You're welcome.

Just for info.

You can assign a macro to just about any object.

An inserted picture, wordart and objects like that.


Gord

On Thu, 15 Nov 2007 09:19:06 -0800, Finance Guru
wrote:

Gord - just an update for you. I see what you mean,although it took me couple
of minutes to figure it all out, dooooooooooooooooooooo. Now i understand how
it's done it's easy

You are the main man!
Thanks a lot
FG


"Gord Dibben" wrote:

Try ViewToolbarsForms.

Click on the button icon and draw a button wherever you wish.

Assign the macro to that button.


Gord Dibben MS Excel MVP

On Thu, 15 Nov 2007 06:14:04 -0800, Finance Guru
wrote:

What I am attempting to is :

ToolsCustomiseFormsButton. Then drag a Button icon up onto the worksheet
and place it somewhere around cell E4.( Im not really bothered exactly where
),but E4 sounds a good a place as any. It want to drag the button on to the
worsheet,bu using the above, will only allow me to drag the button up on to
another toolbar,Which is what I don't want). I have seen this done
previoualy,but i have forgotten,where and how.

hth
FG


"Dave Peterson" wrote:

I don't understand. This is the macro that would be assigned to any button from
the forms toolbar on any worksheet.

It'll clear the contents of the specified range when the user clicks on that
button.

Finance Guru wrote:

Hello Dave - Thanks for that,but what I really want is the button within the
worksheet,as the user(s) will not always know how to run a macro,hence the
requirement for the button to allow the user to click on,and let the macro
behind it do all the work.

"Dave Peterson" wrote:

You can write your code so that you're only using the active sheet.

Option Explicit
Sub testme()
with activesheet
msgbox .name 'just to verify
.range("b9,c22,e3:g9,h:h,w:x").clearcontents
end with
end sub

Finance Guru wrote:

Hello people,

How can i put a button into my worsheet,and attach a macro to it. so that
the button is only relevant to that w/sheet. I know how to drag a button on
the Toolbar from the Forms toolbar and attach a macro,but the same process
doesn't appear to work for my problem.

What I actually want to do is press this button which will then clear down
designated cells prior to use.

I am using Excel 2004

All offers of help gratefully accepted
FG

--

Dave Peterson


--

Dave Peterson




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
Allow custom update button to work while sheet is protected mhng Excel Discussion (Misc queries) 0 July 14th 06 12:39 AM
use macro button to run macro in protected sheet earl Excel Discussion (Misc queries) 3 February 26th 06 10:21 PM
U.S. Command Button Macro won't work in Australian version 2003 Ron in Dallas Excel Discussion (Misc queries) 1 December 23rd 05 05:08 PM
Spin button in a work sheet - how do I make it work? [email protected] Excel Worksheet Functions 1 April 7th 05 08:43 PM
Assign Macro to button in Excel doesnt work Any ideas? Mike@Becketts Excel Discussion (Misc queries) 2 December 20th 04 02:47 PM


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