Link to home
Start Free TrialLog in
Avatar of mobious74
mobious74

asked on

Autofit and a little cleanup.

I code/script by sheer force of will not by any actual knowledge...so I apologize for extremely messy/ugly code :)

But, I kind of got this do what I want except for 2 things:

The auto fit isn't working and I need to know how if I delete something off the first sheet (DME LOG) it will delete the coresponding cell on the second sheet (DME Data)

I had originally got the auto fit to work by first filling the cell with xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx, running auto fit then populating the cell with my data and running autofit again.  That worked if I wasn't using the do/while loop to add mulitple items if needed...

so basically I would like some tips on how to make this work a little better...or if I'm making this harder than it needs to be.

Essentially, staff will see the first sheet and input data, the 2nd sheet will be hidden and mgmt will be able to look at that...ok, I'm rambling now...workbook is attached, let me know if theres anythign else you need!
DME-Dispensing-Log.xls
ASKER CERTIFIED SOLUTION
Avatar of fhillyer1
fhillyer1

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of mobious74
mobious74

ASKER

and that's why I ask experts! :)

This is awesome...I've been playing with the autofit from what you gave me...but still trying to fit a square peg in a round hole :)

Looked at https://www.experts-exchange.com/questions/20633334/VB-to-Excel-Autofit-Problem.html but was unable to make that work...

Let me know what you think...
i can code something else for the columns autofit, but it will require me like 5 minutes, after i finish with a customer i'll send you an update

in fact here you go buddy
DME-Dispensing-Log.xls
i forgot something please go to the code and update the FitRow sub routine
make sure it looks like the following i just added the Sheet3. before the cells thing
Private Sub FitRow(Lne As Integer)
    Application.ScreenUpdating = False
        Sheet3.Cells(Lne, 1).EntireRow.AutoFit
    Application.ScreenUpdating = True
End Sub

Open in new window

You are a rockstar! Works perfectly and my manager loves it...

The joys of being in IT "I want it to do this....."..."um, OK, give me a day :) (and experts-exchange!)

Cheers