Posts by mr.mac

    Re: Formatting Chart to Fit Image Box

    no good - it still doesn't fit.
    This is the vba code i use to create and insert the graph, if that helps.
    I changed the image-box to stretch mode on the user form itself, but no dice.

    [vba]Private Sub CommandButton2_Click()
    ActiveChart.ChartType = xlLineMarkers
    ActiveChart.SetSourceData Source:=Sheets("Sheet11").Range("A1:J11"), PlotBy _
    ActiveChart.Location Where:=xlLocationAsNewSheet
    With ActiveChart
    .HasTitle = True
    .ChartTitle.Characters.Text = "Ge for Selected Thickness"
    .Axes(xlCategory, xlPrimary).HasTitle = True
    .Axes(xlCategory, xlPrimary).AxisTitle.Characters.Text = "Equations"
    .Axes(xlValue, xlPrimary).HasTitle = True
    .Axes(xlValue, xlPrimary).AxisTitle.Characters.Text = "Ge Value"
    End With
    With ActiveChart
    .HasAxis(xlCategory, xlPrimary) = True
    .HasAxis(xlValue, xlPrimary) = True
    End With
    ActiveChart.Axes(xlCategory, xlPrimary).CategoryType = xlAutomatic
    ActiveChart.HasDataTable = False

    Fname = ThisWorkbook.Path & "\" & ActiveChart.Name & ".gif"
    ActiveChart.Export Filename:=Fname, FilterName:="GIF"
    Image1.Picture = LoadPicture(Fname)
    End Sub[/vba]

    Re: Formatting Chart to Fit Image Box

    Hi Norie,
    I've used picture alingment and picture size mode to no effect.
    The size mode is zoom, stretch and 0, which is default i guess.The alignment is top, bottom, right/left.

    Any other ideas?

    Hi there,
    I've created a chart from excel and saved it as a gif file. I now want to fit it into the image box on my user form.

    At present the imagebox only shows around half the chart as it needs to be much bigger, or the picture much smaller - can i dynamically format the gif file to fit the image box?

    HI there,
    I hope a simple fix to this!

    In my worksheet.sheet1:
    Column A list the names of samples
    Column K-O contain different values of strain within these samples

    So i'ld have

    Sample1 65 76 34 23 etc
    Sample2 35 36 14 3 etc

    where 65,76,34,23 are the strain values for Sample1, and 35,36,14,3 are the strain values for Sample2

    I want to create a bar/column chart in VBA (whichever is best) to represent this.
    Any ideas?

    Re: Manipulating ComboBox values

    That worked perfectly.
    However, if i now want to do more than the SUM command, say i want to implement the following equation on the selected line in the combobox

    (Column B-400.5) - 0.6928(Column C -520))/61.31

    how can i do this?
    THanks again,

    I have 2 questions:
    I'm using a combobox on a userform in order to scroll through data set in an excel sheet.

    This sheet has values in it from columns A to G and from rows 1 to 200.
    Column A has the values for temperature and columns B to G contain the peak position at different measurement intervals.

    I hope you're still with me?!
    When i see the line i want when i'm scrolling down my combobox - say i see that there's an entry for temperature 45 degrees in column A - then i want to use the peak position values from columns B to G to calculate the overall peak value-for this example, say sum the selected values B to G and divide by 6.

    I want to display the calculated result in a msgbox

    Also, when i select the row i want in the combobox only 1 value appears, columna, but no column b to g info - any ideas?

    Many thanks,

    stupid question,
    how can i code so that a value calculated in userform1 is passed to userform2 where it is operated upon.
    i.e. based on inputs to userform1, a value is displayed in a label
    this value is used in further maths in userform2, jsut as soon as i can get my bloody hands on it that is

    2 questions:

    1. Is it possible to copy jpegs that have been bookmarked into another file?
    2. Can i go through my word document and automatically add bookmarks to jpegs present, and then go to step.1?

    go on,make my day!

    Re: Exporting: exporting report in MS WORD

    so this was years ago, but i'm trying to do something similar but i can't see the attachment. I'm trying to copy images selected on a user form into a word document
    can you post it again - or even better, guide me in how i can modify the code to suit my needs?
    many thanks

    Quote from thomach

    Not sure if this will provide what you are looking for. But the attached creates a formatted Work document from an Excel worksheet. The macros are linked to the Text Boxes on the summary sheet.