6 Replies - 668 Views - Last Post: 14 May 2013 - 04:45 AM Rate Topic: -----

#1 vimilac  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 5
  • Joined: 13-May 13

My 1st Vba project - something in the logic escapes me

Posted 13 May 2013 - 04:23 PM

They assigned me this at work to alleviate problems with our production people overwriting formulas or editing data.
I've never had to write an automation code for a spreadsheet before, so I hope I had the right idea here. the spreadsheet this stuff goes into has about only ten columns to fill.
Essentially, what happens is that a product(electronic devices on wafers) is accurately weighed before processing. The code interacts with the operator through a series of dialog boxes and userforms to input values into the correct cells on a worksheet. After processing(electroplating), the article is weighed again and difference with the pre-processing weight is presumed to be the quantity of metal deposited. Therefore, the spreadsheet has two command buttons - pre-process and post-process data entry. What I have down so far has a few bugs in it - but it messes up when there is only one wafer in the lot, so there's a logic error in here that I'm not seeing. I've gotten run-time errors, too & more might occur since I haven't completely tested the code for robustness in all foreseeable inputs and situations.
There are 4 userforms that are encountered: The first is called simply UserForm1, the second box encountered I've named AddRemoveWafers for adjusting a wafer lot after upstream scrap losses. The third box is called WaferData - it includes user inputs that are unique to an individual wafer. Finally, the PostWeigh_Wfrs form is used after the process is complete to upload the post electroplated weight of the entire wafer and calculate the pre and post weight difference to check & see if it's within specs. I don't currently have this block of code on hand, but it's relatively simple & I haven't had issues with it. But it does raise one question..Can the backcolor and/or font color in a textbox be changed using a Vba conditional statement?

Attached File(s)



Is This A Good Question/Topic? 0
  • +

Replies To: My 1st Vba project - something in the logic escapes me

#2 vimilac  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 5
  • Joined: 13-May 13

Re: My 1st Vba project - something in the logic escapes me

Posted 13 May 2013 - 04:50 PM

Forgot to post illustrations of the userforms that I had made for this project..

Attached image(s)

  • Attached Image

Was This Post Helpful? 0
  • +
  • -

#3 GunnerInc  Icon User is offline

  • "Hurry up and wait"
  • member icon




Reputation: 858
  • View blog
  • Posts: 2,287
  • Joined: 28-March 11

Re: My 1st Vba project - something in the logic escapes me

Posted 13 May 2013 - 04:53 PM

moving...
Was This Post Helpful? 0
  • +
  • -

#4 vimilac  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 5
  • Joined: 13-May 13

Re: My 1st Vba project - something in the logic escapes me

Posted 13 May 2013 - 06:53 PM

Hey - sorry to all - I screwed up the posting the first time around - I'll load the actual worksheet up tomorrow - I've made a few fixes & changes to my code anyways
Was This Post Helpful? 0
  • +
  • -

#5 vimilac  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 5
  • Joined: 13-May 13

Re: My 1st Vba project - something in the logic escapes me

Posted 14 May 2013 - 03:34 AM

OK - here's a copy of the file. If I make changes or fixes, I'll repost
Was This Post Helpful? 0
  • +
  • -

#6 andrewsw  Icon User is offline

  • It's just been revoked!
  • member icon

Reputation: 3623
  • View blog
  • Posts: 12,510
  • Joined: 12-December 12

Re: My 1st Vba project - something in the logic escapes me

Posted 14 May 2013 - 04:07 AM

Before you progress further I suggest that you rename all of your controls using sensible prefixes; textbox1, etc., is useless going forward.

frm, txt, cbo, cmd, lst, chk, etc.

Use camelcase: frmRemoveWafers

Your file is not attached.

Yes, it will be possible to change font characteristics based on conditional statements.

This post has been edited by andrewsw: 14 May 2013 - 04:09 AM

Was This Post Helpful? 1
  • +
  • -

#7 vimilac  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 5
  • Joined: 13-May 13

Re: My 1st Vba project - something in the logic escapes me

Posted 14 May 2013 - 04:45 AM

All right - thanks all for taking a look, but I think I've got it fixed & running now. I'll remember this board if anything else comes up & read some of the topics posted here to hopefully improve my competence.
Was This Post Helpful? 0
  • +
  • -

Page 1 of 1