Autofit and a little cleanup.

Posted on 2009-12-28
Last Modified: 2012-05-08
I code/script by sheer force of will not by any actual 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!
Question by:mobious74
    LVL 5

    Accepted Solution

    here it is your file, ill work on the column width a bit later, but i'll send you what i was able to accomplish during lunch time, i only left you with 1 form, not 2, you dont need them, based on the column you are able to tell where to go
    analyse the code and i added the delete thing you needed, when you delete a cell on the log one it deletes its correspondent cell on the data sheet

    Author Comment

    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 but was unable to make that work...

    Let me know what you think...
    LVL 5

    Expert Comment

    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
    LVL 5

    Expert Comment

    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


    Author Closing Comment

    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!)


    Featured Post

    6 Surprising Benefits of Threat Intelligence

    All sorts of threat intelligence is available on the web. Intelligence you can learn from, and use to anticipate and prepare for future attacks.

    Join & Write a Comment

    A little background as to how I came to I design this code: Around 5 years ago I designed an add-in that formatted Excel files to a corporate standard, applying different cell colours and font type depending on whether the cells contained inputs,…
    Enums (shorthand for ‘enumerations’) are not often used by programmers but they can be quite valuable when they are.  What are they? An Enum is just a type of variable like a string or an Integer, but in this case one that you create that contains…
    The viewer will learn how to use a discrete random variable to simulate the return on an investment over a period of years, create a Monte Carlo simulation using the discrete random variable, and create a graph to represent the possible returns over…
    This Micro Tutorial will demonstrate on a Mac how to change the sort order for chart legend values and decrpyt the intimidating chart menu.

    754 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    26 Experts available now in Live!

    Get 1:1 Help Now