![]() |
![]() |
|
|||||||
| Excel Questions All Excel/VBA questions - formulas, macros, pivot tables, general help, etc. Please post to this forum in English only. |
![]() |
|
|
Thread Tools | Display Modes |
|
|
#1 |
|
New Member
Join Date: May 2002
Location: Baltimore
Posts: 29
|
Anyone know where to place code, to select a range after the splash screen is ran? I have tried two locations and neither is working. Unless I'm using the wrong code to select.
Sheets("Pizza Parlor").Select Range("A5") |
|
|
|
|
|
#2 |
|
Legend
Join Date: Feb 2002
Location: Minneapolis, Mn, USA
Posts: 9,704
|
Try putting the following in the workbook_open procedure in the "ThisWorkbook" module:
Code:
Application.Goto Sheets(1).[a5] Hope this helps. _________________ Cheers, NateO ![]() [ This Message was edited by: NateO on 2002-05-09 14:07 ] |
|
|
|
|
|
#3 |
|
Board Regular
Join Date: Feb 2002
Location: Huntington Beach, CA USA
Posts: 327
|
Sorry, misread the question!!!
James _________________ [ This Message was edited by: James on 2002-05-09 14:07 ] |
|
|
|
|
|
#4 |
|
MrExcel MVP
Join Date: Apr 2002
Location: Vancouver BC , Canada
Posts: 6,259
|
Private Sub Workbook_Open()
Sheets("Pizza Parlor").Range("A5").select End Sub
__________________
<MARQUEE>...........Never be afraid to try something new. Remember, amateurs built the ark, professionals built the Titanic...............The easiest thing to find is fault, don't be easy !.. --Anonymous--...</marquee> |
|
|
|
|
|
#5 |
|
New Member
Join Date: May 2002
Location: Baltimore
Posts: 29
|
Yep, that did it. thanks. Is there an easy way to shorten these if statements?
If OPTPan.Value = True Then Sheets("Order Table").Range("C" & intcurrentrow).Value = "Personal" Sheets("Order Table").Range("D" & intcurrentrow).Value = 4.99 + 0.5 * bytToppings End If If OPT10inch.Value = True Then Sheets("Order Table").Range("C" & intcurrentrow).Value = "10 inch" Sheets("Order Table").Range("D" & intcurrentrow).Value = 5.99 + 0.5 * bytToppings End If If OPT12inch.Value = True Then Sheets("Order Table").Range("C" & intcurrentrow).Value = "12 inch" Sheets("Order Table").Range("D" & intcurrentrow).Value = 7.99 + 0.5 * bytToppings End If If OPT14inch.Value = True Then Sheets("Order Table").Range("C" & intcurrentrow).Value = "14 inch" Sheets("Order Table").Range("D" & intcurrentrow).Value = 9.99 + 0.5 * bytToppings End If If OPT16inch.Value = True Then Sheets("Order Table").Range("C" & intcurrentrow).Value = "16 inch" Sheets("Order Table").Range("D" & intcurrentrow).Value = 10.99 + 0.5 * bytToppings End If If OPTSicilian.Value = True Then Sheets("Order Table").Range("C" & intcurrentrow).Value = "Sicilian" Sheets("Order Table").Range("D" & intcurrentrow).Value = 11.5 + 0.5 * bytToppings End If |
|
|
|
|
|
#6 |
|
Legend
Join Date: Feb 2002
Location: Minneapolis, Mn, USA
Posts: 9,704
|
I get an error with this if I run it from a different sheet:
Code:
Sheets("Pizza Parlor").Range("A5").select
Code:
Application.Goto ("Pizza Parlor").[a5]
|
|
|
|
|
|
#7 |
|
MrExcel MVP
Join Date: Apr 2002
Location: Vancouver BC , Canada
Posts: 6,259
|
Change your Option buttons to a dropdown list then all the if's could be replaced with one case statement
__________________
<MARQUEE>...........Never be afraid to try something new. Remember, amateurs built the ark, professionals built the Titanic...............The easiest thing to find is fault, don't be easy !.. --Anonymous--...</marquee> |
|
|
|
|
|
#8 |
|
Legend
Join Date: Feb 2002
Location: Minneapolis, Mn, USA
Posts: 9,704
|
I personally like your option buttons, and they work, not sure why you'd want to 'fix' them....Did Jay's code work?
I'd personally focus more on creating an 'update address' button, form and corresponding code, in the event that your customer keeps their phone number and changes address'.... _________________ Cheers, NateO ![]() [ This Message was edited by: NateO on 2002-05-09 14:13 ] |
|
|
|
|
|
#9 |
|
New Member
Join Date: May 2002
Location: Baltimore
Posts: 29
|
The first one worked Nate. Well I'll just keep the crappy if's then. I need to format the Range D for currency also. What code would I place after?
|
|
|
|
|
|
#10 |
|
Legend
Join Date: Feb 2002
Location: Minneapolis, Mn, USA
Posts: 9,704
|
Code need not apply. Go to your second sheet, click on D (column header) than click the $ button. This should be all that is required.
Did you try Jay's array code? _________________ Cheers, NateO ![]() [ This Message was edited by: NateO on 2002-05-09 14:15 ] |
|
|
|
![]() |
| Bookmarks |
| Thread Tools | |
| Display Modes | |
|
|