#1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2
Default print

Hi, all

I am very new to this forum. but i know i can get all my answers here.

I have several commands buttons on an excel sheet and when i assigned a
hyperlink macro to say, when i click on cmd button A1, it leads me to Sheet2
B2. That's fine. but when i click on cmd button A2, it sends me to Sheet2B2
again. am quite new to VBA, macros and all that stuff and would like to have
help for me to have a macro which would enable me to have different worksheet
links assigned different command buttons

Thanks
ruben
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 92
Default print

Try this
Private Sub CommandButton1_Click()
Sheets("Sheet 1").Select
End Sub

Private Sub CommandButton2_Click()
Sheets("Sheet 2").Select
End Sub

and so on

"ruben" wrote:

Hi, all

I am very new to this forum. but i know i can get all my answers here.

I have several commands buttons on an excel sheet and when i assigned a
hyperlink macro to say, when i click on cmd button A1, it leads me to Sheet2
B2. That's fine. but when i click on cmd button A2, it sends me to Sheet2B2
again. am quite new to VBA, macros and all that stuff and would like to have
help for me to have a macro which would enable me to have different worksheet
links assigned different command buttons

Thanks
ruben

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 6
Default print

Mark Dullingham wrote:
Try this
Private Sub CommandButton1_Click()
Sheets("Sheet 1").Select
End Sub

Private Sub CommandButton2_Click()
Sheets("Sheet 2").Select
End Sub

and so on

Hi, all

[quoted text clipped - 9 lines]
Thanks
ruben


Thanks Mark for the help. I've tried the code in sheet 1 and it gives me an
error message when i runs the macro "subscript put of range" and highlights
the "Sheets("Sheet 1").Select".

What i understand is that the macro will jump to another worksheet on a
button click. But let mre b more precise about my problem. In my excel sheet,
Sheet 1 contains several command buttons which i would like to link each of
the button to their respective cell in sheet 2. Sheet 2 contains hundreds of
invoices, each of them copied under the other and the spacing between the
cell to be linked in invoice No2 (F54) is 45 cells below invoice No1. So it
goes on F9, F54, F99, etc... Is there a way Dan to link the command buttons
to write a macro which will tell the command button1 to go to F9, command
button 2 to F54, etc.? If you could get me out of this hell, please.

Many thanks
ruben

--
Message posted via http://www.officekb.com
  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 92
Default print

Sorry Ruben it was late and I didn't try the code first.
Have you tried using hyperlinks instead!

"ruben via OfficeKB.com" wrote:

Mark Dullingham wrote:
Try this
Private Sub CommandButton1_Click()
Sheets("Sheet 1").Select
End Sub

Private Sub CommandButton2_Click()
Sheets("Sheet 2").Select
End Sub

and so on

Hi, all

[quoted text clipped - 9 lines]
Thanks
ruben


Thanks Mark for the help. I've tried the code in sheet 1 and it gives me an
error message when i runs the macro "subscript put of range" and highlights
the "Sheets("Sheet 1").Select".

What i understand is that the macro will jump to another worksheet on a
button click. But let mre b more precise about my problem. In my excel sheet,
Sheet 1 contains several command buttons which i would like to link each of
the button to their respective cell in sheet 2. Sheet 2 contains hundreds of
invoices, each of them copied under the other and the spacing between the
cell to be linked in invoice No2 (F54) is 45 cells below invoice No1. So it
goes on F9, F54, F99, etc... Is there a way Dan to link the command buttons
to write a macro which will tell the command button1 to go to F9, command
button 2 to F54, etc.? If you could get me out of this hell, please.

Many thanks
ruben

--
Message posted via http://www.officekb.com

  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 6
Default print

Mark Dullingham wrote:
Sorry Ruben it was late and I didn't try the code first.
Have you tried using hyperlinks instead!

Try this
Private Sub CommandButton1_Click()

[quoted text clipped - 29 lines]
Many thanks
ruben


Yes i did mark, but i am sure u'll understand that it's really cumbersome for
hundreds of invoice. i was just thinking how a macro can help me.

pls help if u do know a solution.

Many thanks
Ruben

--
Message posted via OfficeKB.com
http://www.officekb.com/Uwe/Forums.a...mming/200605/1


  #6   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 92
Default print

Ruben
I have set up a worksheet and tested the following code and it works for me.
If tyour sheets are not named ("Sheet2"( then enter "yoursheetname" in
between th (" ") marks in the code
Private Sub CommandButton1_Click()
Sheets("Sheet2").Select
ActiveSheet.Range("F9").Select
End Sub

Private Sub CommandButton2_Click()
Sheets("Sheet2").Select
ActiveSheet.Range("F54").Select
End Sub

Private Sub CommandButton3_Click()
Sheets("Sheet2").Select
ActiveSheet.Range("F99").Select
End Sub
Hope this helps

"ruben via OfficeKB.com" wrote:

Mark Dullingham wrote:
Sorry Ruben it was late and I didn't try the code first.
Have you tried using hyperlinks instead!

Try this
Private Sub CommandButton1_Click()

[quoted text clipped - 29 lines]
Many thanks
ruben


Yes i did mark, but i am sure u'll understand that it's really cumbersome for
hundreds of invoice. i was just thinking how a macro can help me.

pls help if u do know a solution.

Many thanks
Ruben

--
Message posted via OfficeKB.com
http://www.officekb.com/Uwe/Forums.a...mming/200605/1

  #7   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 6
Default print

Mark Dullingham wrote:
Ruben
I have set up a worksheet and tested the following code and it works for me.
If tyour sheets are not named ("Sheet2"( then enter "yoursheetname" in
between th (" ") marks in the code
Private Sub CommandButton1_Click()
Sheets("Sheet2").Select
ActiveSheet.Range("F9").Select
End Sub

Private Sub CommandButton2_Click()
Sheets("Sheet2").Select
ActiveSheet.Range("F54").Select
End Sub

Private Sub CommandButton3_Click()
Sheets("Sheet2").Select
ActiveSheet.Range("F99").Select
End Sub
Hope this helps

Sorry Ruben it was late and I didn't try the code first.
Have you tried using hyperlinks instead!

[quoted text clipped - 12 lines]
Many thanks
Ruben


Perfect Mark.

Thanks for kindly testing it before. It's working just fine and you 've
relieved me from hours of linking.

Cheers
ruben

--
Message posted via OfficeKB.com
http://www.officekb.com/Uwe/Forums.a...mming/200605/1
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
Print and Print Preview Graphic Moving Resizing 2007/2003 Adam Rayburn Excel Discussion (Misc queries) 0 April 4th 07 04:18 PM
cell borders that I create dont show on print preview or print scott3435 Excel Discussion (Misc queries) 2 April 6th 06 02:37 AM
Pivot Table macro to set print area and print details of drill down data Steve Haskins Excel Discussion (Misc queries) 2 December 28th 05 04:59 PM
Active cell counting in particular print page (one sheet having different print area) ananthmca2004 Excel Worksheet Functions 1 November 24th 05 11:29 AM
Need Help w/ Print Macro to Print All Visible Sheets (including Charts) in a Workbook will Excel Programming 3 September 23rd 04 08:05 PM


All times are GMT +1. The time now is 04:30 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"