Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
DiscussionsAccessExcelInfoPathOutlookPowerPointPublisherWord
DirectoryUser Groups
Related Topics
Outlook ExpressInternet ExplorerWindowsMS Server ProductsMore Topics ...

MS Office Forum / Excel / Worksheet Functions / March 2008

Tip: Looking for answers? Try searching our database.

Option Buttons that use macros

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
SteveS - 19 Mar 2008 04:48 GMT
I have a workbook that I am trying to use 2 option buttons that use macros to
copy and paste data in one cell in a separate worksheet to 7 other cells in a
row in the same worksheet.

One option button is named CASH and the other is named CREDIT and I want the
macro to copy cell N10 in worksheet 'Markup Calculator' to cells F10:M10 when
the CASH option button is pushed in worksheet 'Print Me - Retail' and then
return to the 'Print Me - Retail' worksheet.

The same for the second options button named CREDIT. I want the same thing
to happen except I want cell N11 to be copied to cells F10:M10 and also
return to the 'Print Me - Retail' worksheet.

Any help would be appreciated. I have tried to recorded the macro sequence
but it seems to get stuck at Range("N10").Select when I try to copy the code
into the:

Sub MacroCash()
'
' MacroCash Macro
' CASH
'

'
   Sheets("Markup Calculator").Select
   Range("N10").Select
   Selection.Copy
   Range("F10").Select
   ActiveSheet.Paste
   Range("G10").Select
   ActiveSheet.Paste
   Range("H10").Select
   ActiveSheet.Paste
   Range("I10").Select
   ActiveSheet.Paste
   Range("J10").Select
   ActiveSheet.Paste
   Range("K10").Select
   ActiveSheet.Paste
   Range("L10").Select
   ActiveSheet.Paste
   Range("M10").Select
   ActiveSheet.Paste
   Range("F20:G20").Select
   Selection.Hyperlinks(1).Follow NewWindow:=False, AddHistory:=True
   Range("A1").Select
End Sub
Reitanos - 19 Mar 2008 06:37 GMT
You don't have to use copy and paste.
Try something like:

range("f10:m10").formula = range("n10").formula
sheets("Print Me - Retail").select
range("a1").select

I think that's what you were looking for.

> I have a workbook that I am trying to use 2 option buttons that use macros to
> copy and paste data in one cell in a separate worksheet to 7 other cells in a
[quoted text clipped - 43 lines]
>     Range("A1").Select
> End Sub
Reitanos - 19 Mar 2008 14:00 GMT
You can avoid the whole copy/paste thing with something like:

sheets("Markup Calculator").range("f10:M10").formula = sheets"Print Me
- Retail").range("n10").formula

I don't quite understand what else you want to do

> I have a workbook that I am trying to use 2 option buttons that use macros to
> copy and paste data in one cell in a separate worksheet to 7 other cells in a
[quoted text clipped - 43 lines]
>     Range("A1").Select
> End Sub
SteveS - 19 Mar 2008 14:46 GMT
YOU ROCK! I am a VB idiot and you just took something so simple and made our
business have a new tool that is of tremendous value!

Thanks so much!

> You can avoid the whole copy/paste thing with something like:
>
[quoted text clipped - 50 lines]
> >     Range("A1").Select
> > End Sub
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.