Actuarial Outpost
 
Go Back   Actuarial Outpost > Actuarial Discussion Forum > Software & Technology
FlashChat Actuarial Discussion Preliminary Exams CAS/SOA Exams Cyberchat Around the World Suggestions

US HEALTH ACTUARIAL JOBS

Reply
 
Thread Tools Display Modes
  #1  
Old 11-01-2002, 05:29 AM
no
Guest
 
Posts: n/a
Default Excel VBA help

I wrote some VBA macros. It has a few UserForms so users could choose their input. I want user to be able to edit some data, like 2rows and 5 columns, if (s)he does not like default values assigned by the program. Right now what I am doing is highlighting that block in an Excel worksheet and then transfering the controls back to Excel. User can change the block, restart again, skipping the editing part. Am I making myself clear?

Is there a better way to do it? I looked at Modeless UserForms but it does not work. One thing I thought was using smartforms as given in ``Definitive guides to Excel VBA'' by Kofler. But the problem is the dimension of the block to be edited is determined by the user's input.

I use Excel 2002.
Reply With Quote
  #2  
Old 11-01-2002, 03:25 PM
NoName's Avatar
NoName NoName is offline
Site Supporter
Site Supporter
 
Join Date: Nov 2001
Posts: 5,859
Default

I don't use user forms, but I did an experiment where I put up a user form and set ShowModal to false, and it did allow me to input data on the spreadsheet while the user form was running. This is with Excel 2000. However, the help says that it the property will be ignored in Excel 97.
Reply With Quote
  #3  
Old 11-01-2002, 05:18 PM
no
Guest
 
Posts: n/a
Default

Thanks NoName.

What you are suggesting is using modeless userforms. I did try that, it does not work properly when you have more than 1 userform per run.

I did a search on google and foundout some info. I'll post the results if it works the way I want.
Reply With Quote
  #4  
Old 12-06-2002, 12:59 PM
Basso's Avatar
Basso Basso is offline
Member
CAS AAA
 
Join Date: Oct 2002
Location: Italy
Posts: 2,499
Default

Okay, I feel dumb for having to post this, but here goes:

I am trying to get the active cell to move down 1 row. This would be easy, [cells(selection.row + 1, selection.column).select] but I have some hidden rows because I am navigating a filtered list, so it goes to a cell that is filtered out. How do I get it to perform as if I had just hit the "down" arrow on the keyboard?

I am using Excel 2000. Any help would be greatly appreciated!
Reply With Quote
  #6  
Old 12-06-2002, 05:14 PM
Brad Gile's Avatar
Brad Gile Brad Gile is offline
Member
CAS SOA AAA
 
Join Date: Sep 2001
Studying for whatever I feel like
College: Alumnus of Brown and UW-Madison
Posts: 11,136
Default

Quote:
Originally Posted by NoName
I don't know if there's a direct way to do it, but you can put the code to increment inside a do loop with the condition "Loop while rows(activecell.row).hidden"
Exactly. I can't see a better way.

Sub junk()
'1. MOVE DOWN 1 ROW
ActiveCell.Offset(1, 0).Range("a1").Select
'2. IF ACTIVE ROW IS HIDDEN, KEEP MOVING!
Do While Rows(ActiveCell.Row).Hidden
ActiveCell.Offset(1, 0).Range("a1").Select
Loop
End Sub

Brad
Reply With Quote
  #7  
Old 12-06-2002, 05:43 PM
Basso's Avatar
Basso Basso is offline
Member
CAS AAA
 
Join Date: Oct 2002
Location: Italy
Posts: 2,499
Default

Thanks!

Sometimes I miss Lotus 123.
Reply With Quote
  #8  
Old 12-07-2002, 07:13 PM
Brad Gile's Avatar
Brad Gile Brad Gile is offline
Member
CAS SOA AAA
 
Join Date: Sep 2001
Studying for whatever I feel like
College: Alumnus of Brown and UW-Madison
Posts: 11,136
Default

Quote:
Originally Posted by DogBoy2
Thanks!

Sometimes I miss Lotus 123.
Do you really? I sure don't, and I used it from version 1A (before that I had VisiCalc!) to Excel97. Lotus 123 was a wonderful product, but Lotus dropped the ball completely when Windows 95 came out and Lotus didn't even have a plan for a 32 bit version. Lotus was also revolutionary in having a macro language, but they never developed it beyond a mere toy.

When MS put VBA in Excel, they blew Lotus away forever. That's when I switched to Excel and never looked back.

Brad
Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off


All times are GMT -4. The time now is 11:44 AM.


Powered by vBulletin®
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.
*PLEASE NOTE: Posts are not checked for accuracy, and do not
represent the views of the Actuarial Outpost or its sponsors.
Page generated in 0.19302 seconds with 7 queries