Register a SA Forums Account here!
JOINING THE SA FORUMS WILL REMOVE THIS BIG AD, THE ANNOYING UNDERLINED ADS, AND STUPID INTERSTITIAL ADS!!!

You can: log in, read the tech support FAQ, or request your lost password. This dumb message (and those ads) will appear on every screen until you register! Get rid of this crap by registering your own SA Forums Account and joining roughly 150,000 Goons, for the one-time price of $9.95! We charge money because it costs us money per month for bills, and since we don't believe in showing ads to our users, we try to make the money back through forum registrations.
 
  • Post
  • Reply
baquerd
Jul 2, 2007

by FactsAreUseless
I have this CSV bcp file with dates in it. Fully formatted dates like "Jan 11 2012 8:15:00:000AM". Excel thinks they're text and only wants to sort them alphabetically. I have already tried using the extended sort feature that lets me pick "Jan Feb Mar" instead of "Normal", but this does nothing. Any ideas?

Adbot
ADBOT LOVES YOU

Old James
Nov 20, 2003

Wait a sec. I don't know an Old James!

baquerd posted:

I have this CSV bcp file with dates in it. Fully formatted dates like "Jan 11 2012 8:15:00:000AM". Excel thinks they're text and only wants to sort them alphabetically. I have already tried using the extended sort feature that lets me pick "Jan Feb Mar" instead of "Normal", but this does nothing. Any ideas?

Add a column with the formula "=datevalue(A1)" and use that column to sort.

baquerd
Jul 2, 2007

by FactsAreUseless

Old James posted:

Add a column with the formula "=datevalue(A1)" and use that column to sort.

That chokes on the formatted text I have above, and it also choked on "Apr 12 2012". Figured out it wants a comma after the day in order to parse the date, but I can't figure out how to get it to deal with any time text that's added on to it. I'll just run it through a converter, split into two columns, and date format one and time format the other...

kapinga
Oct 12, 2005

I am not a number

baquerd posted:

That chokes on the formatted text I have above, and it also choked on "Apr 12 2012". Figured out it wants a comma after the day in order to parse the date, but I can't figure out how to get it to deal with any time text that's added on to it. I'll just run it through a converter, split into two columns, and date format one and time format the other...

Since the format you have is fixed width, you could use a combination of LEFT(str, num_chars) and RIGHT(str, num_chars) to break the date and times apart. From there, you would need DATEVALUE() and TIMEVALUE(), as well as adding that comma that you noted needs to be in the date.

If you can get away with a one-time reformat, that's probably faster though.

Turkeybone
Dec 9, 2006

:chef: :eng99:
So I have a largely academic question. I just took a final in my VBA class (heh) and the coding question was basically, "Given x words to search for, y sheets in the workbook, and z cells on each sheet, count the occurrences of each search word in the workbook." Now, the brute-force, good-enough-for-the-class solution is just three nested loops:

'for each word in the range of "search word" cells
'for each sheet not named "Count" in the workbook
'for each cell in the continuous range (starting at A1) in the sheet
'if search word = the cell, increment the counter
' output each count

So that has complexity of like n^3 and runs really slowly and poorly. So I was wondering how it would be possible to cut down the complexity. Maybe creating some sort of dictionary and like, well if the word isn't in the dictionary just error handle and move on? At they very least something like that would cut out the "for each word in the range of search words" loop. Thoughts? I'm still a novice in programming in general, so I get the ideas but not the exact implementations yet.

Old James
Nov 20, 2003

Wait a sec. I don't know an Old James!

The cells.find method should be able to search an entire workbook at once. So you would only need one For loop going through workbooks and then if the .find has at least 1 match, a Do While loop using the cells.findnext and a counter.

Old James fucked around with this message at 23:56 on Dec 10, 2012

The Gripper
Sep 14, 2004
i am winner
If I'm remembering correctly Microsoft's actual solution to the count of <word> in <range> problem is to use an array formula and substitute each occurrence of <word> with an empty string, so the count can be determined by sum(original range length - new range length) / length of <word>.

I have absolutely no idea on the actual complexity of it, but in cases where your bottleneck is CPU and you have enough available memory it seems like it'd be more efficient than looping over each cell.

I also don't actually know how array formulas transfer into VBA, so that solution might not be at all practical in your situation.

Elysium
Aug 21, 2003
It is by will alone I set my mind in motion.
I have an excel document that looks something like this:

code:
casenumber	category_name	question_text			observation
  524			HX01	Onset					1
  524			HX02	Quality of the pain			0
  524			HX03	What makes the pain better?		1
Except it's 800 hundred rows long, comprising 40 sets of 20 rows (HX01-20), with each of the 40 sets being the same except with different values for observation (1 or 0).

What I need to do is to take each of the 40 sets and put them each on a slide in powerpoint.

So I'll have one powerpoint document labeled case 524, with 40 slides in it, each slide having the same 20 rows but with their corresponding unique observations.

Is there some way I can do this automatically without just selecting the right ranges and copy/pasting 40 times (and then 40 more times for every case?)

All the ways I have found so far for exporting from excel to powerpoint only involve putting info on one slide. I can't figure out if it's possible to spread the data correctly over 40 slides.

Old James
Nov 20, 2003

Wait a sec. I don't know an Old James!


It's definitely possible, but the time to code and test such a macro might take longer than the time you would spend copy/pasting the rows. So unless you have to repeat this task fairly frequently then I would suggest blasting some music, shutting off your brain, and start ctrl+c and ctrl+v'ing.

edmund745
Jun 5, 2010
I have a program I wrote (that works with numbers) that I want to be able to generate a text file that can then be imported into common spreadsheet programs. I know about delimited text files, but the thing is I want to be able to specify separate sheets. Like, have one table on sheet 1, the next on sheet 2 and so on.

I thought there was a fairly-simple way to do this with xml but if so, I can't figure it out.

I have found a few XML exporters, but the same kind of file (I wrote a small test file, copying from the image) doesn't work for importing--at least with Libreoffice... ?
One exporter-
http://digitalimprint.com/misc/oooexport/

Is there a way to specify multiple sheets in a imported text file?

Turkeybone
Dec 9, 2006

:chef: :eng99:

Turkeybone posted:

So I have a largely academic question. I just took a final in my VBA class (heh) and the coding question was basically, "Given x words to search for, y sheets in the workbook, and z cells on each sheet, count the occurrences of each search word in the workbook." Now, the brute-force, good-enough-for-the-class solution is just three nested loops:

'for each word in the range of "search word" cells
'for each sheet not named "Count" in the workbook
'for each cell in the continuous range (starting at A1) in the sheet
'if search word = the cell, increment the counter
' output each count

So that has complexity of like n^3 and runs really slowly and poorly. So I was wondering how it would be possible to cut down the complexity. Maybe creating some sort of dictionary and like, well if the word isn't in the dictionary just error handle and move on? At they very least something like that would cut out the "for each word in the range of search words" loop. Thoughts? I'm still a novice in programming in general, so I get the ideas but not the exact implementations yet.

So actually there is a specific boolean in dictionaries called .exists, which checks if something is a key in a dictionary. So what I did was create a dictionary with my search words as keys, and the values as 0. So for each word in a cell, if it exists in the dictionary then I increment the counter. It runs MUCH faster. The two lines about "R1" are just to show someone else how fast it runs.

code:

Dim dict As Dictionary
Dim wordRange As Range
Dim myCell As Range
Dim ws As Worksheet
Dim rng As Range

Set dict = New Dictionary
Set wordRange = Sheets("Count").Range("A1").CurrentRegion
For Each myCell In wordRange
    dict.Add myCell.Value, 0
 
Next

Sheets("Count").Range("R1").Value = 0
For Each ws In ThisWorkbook.Worksheets
    If ws.Name <> "Count" Then
        For Each rng In ws.UsedRange.Cells
            If dict.Exists(rng.Text) Then
                dict.Item(rng.Text) = dict.Item(rng.Text) + 1
                Sheets("Count").Range("R1").Value = Sheets("Count").Range("R1").Value + 1
            End If
        Next
    End If
Next
For Each myCell In wordRange
    myCell.Offset(0, 1).Value = dict.Item(myCell.Text)
Next

End Sub

ShimaTetsuo
Sep 9, 2001

Maximus Quietus

Turkeybone posted:

So actually there is a specific boolean in dictionaries called .exists, which checks if something is a key in a dictionary. So what I did was create a dictionary with my search words as keys, and the values as 0. So for each word in a cell, if it exists in the dictionary then I increment the counter. It runs MUCH faster. The two lines about "R1" are just to show someone else how fast it runs.

In terms of algorithm that seems much better.

However, you also have a VBA specific issue: don't use the spreadsheet as if it was actually part of your workspace. It is NOT just a big array that's always there: reading and writing to the sheet is very very slow. Much slower than accessing variables.

So the loop on the cells involves reading each cell from the workbook all the way to VBA, one at a time. Unless you have too much data (not sure what the limit is), you can copy the entire ws.UsedRange.Cells range into an array in one go, then loop over that instead. It'll depend on how much data you have but I made a small (3000 cells) example and it was 100 times faster.

Turkeybone
Dec 9, 2006

:chef: :eng99:
Ahhh, interesting, I will check that out too! This is already way beyond even the knowledge of the instructor, which I am totally okay with :)

The Betrayer
Jan 1, 2005

I've been tasked by my office to build a spreadsheet tracking various systems and their statuses.

I'm looking for a way to be able to count multiple status codes, but my formula knowledge extends to simple counting and not multiple variables.

Basically, I need to be able to enter foo and bar and fizz into any one of about 20 columns and have them calculated elsewhere. If this is a "Just take an Excel course" question, then I'm sorry, but this is daunting and has a deadline of Thursday.

Veskit
Mar 2, 2005

I love capitalism!! DM me for the best investing advice!

The Betrayer posted:

I've been tasked by my office to build a spreadsheet tracking various systems and their statuses.

I'm looking for a way to be able to count multiple status codes, but my formula knowledge extends to simple counting and not multiple variables.

Basically, I need to be able to enter foo and bar and fizz into any one of about 20 columns and have them calculated elsewhere. If this is a "Just take an Excel course" question, then I'm sorry, but this is daunting and has a deadline of Thursday.

I'm not sure what you're asking honestly, but i think your solution is pivot table. Pivot tables usually solve everything.

Old James
Nov 20, 2003

Wait a sec. I don't know an Old James!

The Betrayer posted:

I've been tasked by my office to build a spreadsheet tracking various systems and their statuses.

I'm looking for a way to be able to count multiple status codes, but my formula knowledge extends to simple counting and not multiple variables.

Basically, I need to be able to enter foo and bar and fizz into any one of about 20 columns and have them calculated elsewhere. If this is a "Just take an Excel course" question, then I'm sorry, but this is daunting and has a deadline of Thursday.

=countif($A$1:$R$1000,"foo")
=countif($A$1:$R$1000,"bar")
=countif($A$1:$R$1000,"fizz")

Xenoborg
Mar 10, 2007

I'm building a spreadsheet to track my investments, and I have a question. Say I have a large table like the excerpt shown below
code:
	A	B	C	D
1	% Total	Type	Style	Size
2	3.01%	Equity	Blend	Large
3	1.65%	Fixed	Value	Mid
4	3.72%	Equity	Growth	Large
5	5.43%	Equity	Growth	Small
6	4.88%	Equity	Blend	Mid
I would like to do a series of sums a the bottom saying what %s are what category. Is there any way to write a formula that will sum up the values in column A if column B is a certain string?

I know I could make a ton of dummy columns with stuff like =if(B1="Equity",A1,0), and then sum those, but was wondering if there is a better way.

Old James
Nov 20, 2003

Wait a sec. I don't know an Old James!

Xenoborg posted:

I'm building a spreadsheet to track my investments, and I have a question. Say I have a large table like the excerpt shown below
code:
	A	B	C	D
1	% Total	Type	Style	Size
2	3.01%	Equity	Blend	Large
3	1.65%	Fixed	Value	Mid
4	3.72%	Equity	Growth	Large
5	5.43%	Equity	Growth	Small
6	4.88%	Equity	Blend	Mid
I would like to do a series of sums a the bottom saying what %s are what category. Is there any way to write a formula that will sum up the values in column A if column B is a certain string?

I know I could make a ton of dummy columns with stuff like =if(B1="Equity",A1,0), and then sum those, but was wondering if there is a better way.

=sumif($B$1:$B$6,"Equity",$A$1:$A$6)
-or alternately-
=sumif($B$1:$B$6,$B$2,$A$1:$A$6)

Xenoborg
Mar 10, 2007

Old James posted:

=sumif($B$1:$B$6,"Equity",$A$1:$A$6)
-or alternately-
=sumif($B$1:$B$6,$B$2,$A$1:$A$6)

Ah great thanks, I had a feeling there was a function for it I just couldn't remember.

coyo7e
Aug 23, 2007

by zen death robot
I know how to do it with VBA however, have they added a function to give you the last date/time that the workbook was saved? I don't like having to enable macros every time I open this workbook, just to have a nice-looking cover/documentation sheet.

DukAmok
Sep 21, 2006

Using drugs will kill. So be for real.

coyo7e posted:

I know how to do it with VBA however, have they added a function to give you the last date/time that the workbook was saved? I don't like having to enable macros every time I open this workbook, just to have a nice-looking cover/documentation sheet.

Not sure on the date thing, but if you save macros in your Personal.xlsb, you don't have to muck around with individual macro-enabled workbooks. Huge time saver for quick one-offs like these.

greasyhands
Oct 28, 2006

Best quality posts,
freshly delivered
I am trying to make a little record keeping spreadsheet that compiles flight and duty times for the previous 12 months. I would like it to only display the last 12 months to avoid clutter, but it needs to track 24 months for accurate previous 3, 6, and 12 month consecutive totals. I would like to be able to add a new line for the new month (A24) and have it automatically "hide" the 1st month (A12) and continue the formulas used in columns D,E and F. Is this possible in Excel or am I going to have to find someone to write some kind of little program to do it?

Here is a screenshot of what I have so far- in the formula view you can see how the formulas are set up (E18 is a 6 month cell, I'm sure you can extrapolate how I did the rest.)

Old James
Nov 20, 2003

Wait a sec. I don't know an Old James!

greasyhands posted:

I am trying to make a little record keeping spreadsheet that compiles flight and duty times for the previous 12 months. I would like it to only display the last 12 months to avoid clutter, but it needs to track 24 months for accurate previous 3, 6, and 12 month consecutive totals. I would like to be able to add a new line for the new month (A24) and have it automatically "hide" the 1st month (A12) and continue the formulas used in columns D,E and F. Is this possible in Excel or am I going to have to find someone to write some kind of little program to do it?

Here is a screenshot of what I have so far- in the formula view you can see how the formulas are set up (E18 is a 6 month cell, I'm sure you can extrapolate how I did the rest.)



You could turn the range into a Table object (click the Insert Tab, first icon on the left) which creates named ranges out of each column, when you add a new line at the bottom it will resize the named ranges to include the new row, and if every cell in a column uses the same formula it will copy that down.

As far as hiding rows, that will have to be done with VBA.

EDIT: Table objects are great, I recommend using them as often as possible.
EDIT2: VVVV That's been inconsistent for me which is why I use tables, but yeah that can work.

Old James fucked around with this message at 05:46 on Jan 19, 2013

ShimaTetsuo
Sep 9, 2001

Maximus Quietus
Do you absolutely need to HIDE those rows, to "reduce clutter"? Why don't you just use freeze panes and scroll, like, once a year?

Excel will usually copy down formulas when you add new rows too, you don't really need to use a table I don't think.

greasyhands
Oct 28, 2006

Best quality posts,
freshly delivered

ShimaTetsuo posted:

Do you absolutely need to HIDE those rows, to "reduce clutter"? Why don't you just use freeze panes and scroll, like, once a year?

Excel will usually copy down formulas when you add new rows too, you don't really need to use a table I don't think.

The idea is to be able to distribute this spreadsheet to a dozen or so people and have them be able to print it off with only 12 rows and them not have to actually know what they are doing other than entering the data. Excel does copy down the formula, but it doesnt work because it needs to only include the current row and the previous 2 (for the 3 months column, anyways) but what it does is add in the new row without removing the first so you end up with 4 months for the first added row, 5 months for the next added row, etc.

Thanks for the suggestion Old James, I'm new to Excel so I barely know what you're saying but at least I have a starting point for learning this.

greasyhands fucked around with this message at 07:44 on Jan 19, 2013

ShimaTetsuo
Sep 9, 2001

Maximus Quietus
You're right that they don't always copy down if you don't use a table (it's something to do with having all columns contain data, and if you dragged down the formulas...not completely clear).

I do have a solution for your other problem however: if you just want to print the last 12 months, use dynamic named ranges. Go to the formulas tab, then Name Manager, then "New...". Create a new named range called "Print_Area", scoped to the sheet your data is on. In the refers to box, type in a formula that returns the range of your data depending on the month. I don't know exactly how your spreadsheet will be set up, but something like:

=INDIRECT("A"&COUNT($A:$A)&":F"&COUNT($A:$A)+11)

You will have to adjust depending on if anything is sitting above row 8 (ideally you wouldn't put anything there and you would start the top of the page). After that's done, you can add another named range called "Print_Titles". Set its "Refers to" box to "$10:$11".

Then, anytime you add a month, the print area (the area of the sheet that gets printed by default) will automatically be the last 12 months plus the header row.

Disharmony
Dec 29, 2000

Like a hundred crippled horses lying crumpled on the ground

Begging for a rifle to come and put them down
I often log my start and end time using the default "Shift+Alt+;" but is there a way I can get seconds to show up and on the third column it will automatically display how long it took me exactly? Something along the lines of this?

(it should be 3 seconds on row 1 and 1 minute on row 2 but you get the point :eng99: )

ShimaTetsuo
Sep 9, 2001

Maximus Quietus

Disharmony posted:

I often log my start and end time using the default "Shift+Alt+;" but is there a way I can get seconds to show up and on the third column it will automatically display how long it took me exactly? Something along the lines of this?

(it should be 3 seconds on row 1 and 1 minute on row 2 but you get the point :eng99: )

The shift+alt+; shortcut always returns the "seconds" part as zero. I don't think there is any way to do this without VBA. You can do something like:

code:
Sub currentTime()
    ActiveCell.Value = Now()
End Sub
Then give it a keyboard shortcut (you can override "shift+alt+;"'s old function if you want) and use exactly like you used the old shortcut. Your column C can then just be the difference of the other two (C3=B3-A3, etc). Then set a custom format to whatever you need ("mm:ss" maybe?). You might have to fiddle with it if you want to get, say "90 seconds" instead of "01:30".

Also, looks like it was a mistake, but I just want to point out that the "3 ms" on your picture is very difficult to measure within Excel/VBA. The shortest time that can easily be measured is 1 second. For shorter times you would have to do something like this...but I doubt that you can hit that keyboard shortcut fast enough anyway.

Old James
Nov 20, 2003

Wait a sec. I don't know an Old James!

Disharmony posted:

I often log my start and end time using the default "Shift+Alt+;"

I've been trying this key combo and nothing happens. What does it do for you?

ShimaTetsuo
Sep 9, 2001

Maximus Quietus

Old James posted:

I've been trying this key combo and nothing happens. What does it do for you?

It's actually ctrl+shift+;, not alt. I forgot to check when I wrote my answer earlier.

It sets the value of the highlighted cell to the current time, but the "seconds" part of the time is always returned as 0.

Ragingsheep
Nov 7, 2009
I've got a worksheet with a bunch of formulas using the indirect function to reference other cells. Is there a way to convert all of that to the "normal" referencing method?

Byers2142
May 5, 2011

Imagine I said something deep here...

Ragingsheep posted:

I've got a worksheet with a bunch of formulas using the indirect function to reference other cells. Is there a way to convert all of that to the "normal" referencing method?

I threw something together that you should be able to adapt into your own thing; not knowing what your spreadsheet looked like, I built a dummy one with INDIRECT functions built into one column. Select the first INDIRECT cell and make sure the column four to the right is empty, and this macro code will spit out the direct reference forumlae into that empty column.

Where it gets complicated is if you have more than one indirect function in a cell, but the macro should give you a basic idea of how to make something that would work in that case.

code:
Sub Indirect_to_Direct()

    Dim SRange As Range
    Dim IFormula As String
    Dim ParsingString As String
    Dim EvalString As String
    Dim RefFormula As String
    
'Not knowing the spreadsheet layout, I just assumed you could select the cell with the indirect function
    
    Set SRange = ActiveCell
    IFormula = SRange.Formula
        
    Do While InStr(IFormula, "INDIRECT") > 0
        
        'Step one, we parse out the new code and put it into a new string, RefFormula
        ParsingString = Mid(IFormula, InStr(IFormula, "INDIRECT") + 9)
        ParsingString = Left(ParsingString, InStr(ParsingString, ")") - 1)
        EvalString = Evaluate(ParsingString)
        RefFormula = Replace(IFormula, "INDIRECT(" & ParsingString & ")", EvalString)
        
        'Step two, we move to a new, empty column to output the new direct-reference formula. 
        'Change the offset to determine the output cell.
        ActiveCell.Offset(0, 4).Select
        ActiveCell.Formula = RefFormula
                
        'Step three, I'm assuming you have more than one cell with an INDIRECT function, so we move back
        'to the old column and the next cell down and look for a new INDIRECT
        ActiveCell.Offset(1, -4).Select
        Set SRange = ActiveCell
        IFormula = SRange.Formula
    Loop

End Sub

Ragingsheep
Nov 7, 2009
This is awesome. Thanks.

Turkeybone
Dec 9, 2006

:chef: :eng99:
Okay, I have a question. I have a db that's a flat file in excel, and I am trying to put it into Access (ugh). One of the columns is pictures (photos of inventory), and I'd like to somehow take these excel objects and turn them into files so I can include them as objects in an Access database. Or hell, even if I could extract the pictures into files that I can name and move around, that would be a start. Any thoughts as to how to go about this?

Old James
Nov 20, 2003

Wait a sec. I don't know an Old James!

Turkeybone posted:

Okay, I have a question. I have a db that's a flat file in excel, and I am trying to put it into Access (ugh). One of the columns is pictures (photos of inventory), and I'd like to somehow take these excel objects and turn them into files so I can include them as objects in an Access database. Or hell, even if I could extract the pictures into files that I can name and move around, that would be a start. Any thoughts as to how to go about this?

This sounds horrible. Someone else please correct me if I am wrong, but in Excel images are not part of the range object but shape objects with coordinate properties. If you import the spreadsheet into Access it won't know which row of data matches which image. I don't think any VBA code would help either.

How many rows of data are you looking at?

Old James fucked around with this message at 04:45 on Feb 11, 2013

The Gripper
Sep 14, 2004
i am winner

Old James posted:

This sounds horrible. Someone else please correct me if I am wrong, but in Excel images are not part of the range object but shape objects with coordinate properties. If you import the spreadsheet into Access it won't know which row of data matches which image. I don't think any VBA code would help either.

How many rows of data are you looking at?
You're right, but it's not super horrible to do anyway.

Visual Basic .NET code:
Function ExportToFile(picture As shape, position As Integer)
     
    Dim MyChart As String, MyPicture, outPath, outFilename As String
    Dim PicWidth As Long, PicHeight As Long
    
    outPath = "E:\code\out\"
    outFilename = outPath & position + 1 & ".jpg"
    
    Application.ScreenUpdating = False

    MyPicture = picture.Name

    PicHeight = picture.Height
    PicWidth = picture.Width

    Charts.Add
    ActiveChart.Location Where:=xlLocationAsObject, Name:="Sheet3"
    MyChart = ActiveChart.Name
     
    With ActiveSheet
        With Sheet3.ChartObjects(1)
            .Width = PicWidth
            .Height = PicHeight
            .Border.LineStyle = 0
        End With
         
        Sheet1.Shapes(MyPicture).Copy
         
        With ActiveChart
            .ChartArea.Select
            .Paste
        End With
         
        ActiveChart.Export Filename:=outFilename, FilterName:="jpg"
        Sheet3.ChartObjects(1).Cut
        Debug.Print picture.Name, position, outFilename
    End With
     
    Application.ScreenUpdating = True
    Sheet1.Activate
    Exit Function
End Function

Public Sub RunExporter()
    Const cellHeight = 142.5
    Dim shape As shape
     
    For Each shape In ActiveSheet.Shapes
        If shape.Type = msoLinkedPicture Or shape.Type = msoPicture Then
            ExportToFile shape, Int(shape.Top / cellHeight)
        End If
    Next
End Sub

RunExporter() loops through each shape in the active sheet, and for each that it determines is an image (msoLinkedPicture type) it will run ExportToFile with the shape to export and the row position of that shape (based on a fixed cell height of 142.50 units). This means each of the cells in your source data must be the same height.

You'll get a directory (outPath variable in ExportToFile) full of files named 1.jpg, 2.jpg etc. based on which row they are in, not accounting for headings or anything like that.

Unfortunately I couldn't figure out what weird scale it was using for shape.Left so I didn't account for what column the picture is in, but hopefully you only have one column with pictures. If not it's *probably* not too hard to work the math out anyway.

Also the code relies on data being in Sheet1 (name of the sheet is unimportant), and the temporary chart being in Sheet3 (name is important), so that will need to be adjusted if you have several sheets and Sheet3 already in use.

It's also a bit hacky because of the way properties of charts are made accessible (ActiveChart does not give access to Width, Height and Border properties or the Cut method, while Sheet3.ChartObjects(1) does) which is why the sheet names are hardcoded as I really couldn't be bothered trying to work that out in a reliable way quickly.

The Gripper fucked around with this message at 17:00 on Feb 11, 2013

Turkeybone
Dec 9, 2006

:chef: :eng99:
Yeah, it's a pretty bad design, and then bringing it into access on top of that. Just completely non-technical college kids at work. :)

It's maybe like 200 rows altogether. I can totally just make a dummy copy and make it work with the constraints of this program; I'll let you know how it turns out, thanks!

Hoops
Aug 19, 2005


A Black Mark For Retarded Posting
How do you add $ signs to fix a cell reference? I've been typing them in manually for years, but during a demonstration today the guy was pressing something and they were appearing automatically.

DukAmok
Sep 21, 2006

Using drugs will kill. So be for real.

Hoops posted:

How do you add $ signs to fix a cell reference? I've been typing them in manually for years, but during a demonstration today the guy was pressing something and they were appearing automatically.

F4 to cycle through the various permutations of absolute references.

Adbot
ADBOT LOVES YOU

maskenfreiheit
Dec 30, 2004
.

maskenfreiheit fucked around with this message at 21:25 on Apr 28, 2019

  • 1
  • 2
  • 3
  • 4
  • 5
  • Post
  • Reply