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
esquilax
Jan 3, 2003

raej posted:

Another weird one. I have a cell that's calculating a duration based on GetCurrentTimeEST()-<another cell>. When I change anything on the other cell, the formula recalculates (good). When I change any other cell on the form, the duration does not re-calculate (bad).

Is there an easy way to update this calculation when ANY cell changes value?

Mark the custom formula GetCurrentTimeEST() as volatile.

I believe you just put "Application.Volatile" in the function code.

Adbot
ADBOT LOVES YOU

sticklefifer
Nov 11, 2003

by VideoGames
I'm in need of a formula, and I'm a bit out of practice with Excel but I know it probably contains the IF and MAX functions.

Context:
Top row using this formula is 9, so E9/F9/G9 are the cells I'll be copying from.
E9 = static amount of 500
F9 = a number I'll be putting in manually, but usually somewhere between 0 and 2000.
G9 = formula location, total/result of calculation

Criteria for formula:
-If F9 is >200, it deducts that number from E9.
-If F9 is <200, it displays the number in E9 (cell reference instead of the number, because the static 500 in E column could change in future documents).
-If result in G9 is less than 0, display 0.


edit: Thanks! I actually put in 201 because 200 shouldn't deduct from E9 either. Works the same.

sticklefifer fucked around with this message at 01:08 on Dec 1, 2015

Ragingsheep
Nov 7, 2009
=if(f9>200,max(0,e9-f9),e9)

What if f9=200?

fosborb
Dec 15, 2006



Chronic Good Poster
=IF(F9>E9,0,IF(F9>=200,E9-F9,E9))

EL BROMANCE
Jun 10, 2006

COWABUNGA DUDES!
🥷🐢😬



I deal with a many tabbed monstrosity of a report each week, and it's easy for errors to creep into it, so I decided to make a test bed workbook that I can load up at the end of it just to check over some things.

I'm trying to work out the easiest way of referencing another workbook (or two in some cases), maybe via a macro although VBA is very much not my strong point. If I could just write it in a cell and have my countifs, lookups etc use that it would be ideal. I've seen people talk about using INDIRECT but can this be used for worksheets or just tabs?

At the moment, whenever I load up the testbed it tells me all my links are dead (which is fair) and I have to do a find/replace for a few things in order to get it pointing to the right documents. Not the end of the world, but I'm sure there's a simpler and more efficient way of doing this.

e: ah think I've got it cracked, at last. Seems most people online looking to do this wanted to do across multiple worksheets whereas I needed workbooks which is slightly different. Did it with INDIRECT in the end.

EL BROMANCE fucked around with this message at 17:32 on Dec 2, 2015

Ragingsheep
Nov 7, 2009
Is there any way to have a range scroll bar in excel that doesn't look like the standard windows scroll bar?

Squashy Nipples
Aug 18, 2007

Sure is! I think you can do it with Windows API functions, but the way I'd probably do that is with a modeless UserForm (ShowModal = False).

That way you can make the graphic look like whatever the hell you want, and just make it scroll with VBA code. you could even put in a ComboBox that would let you jump to certain rows, etc. etc.

MeKeV
Aug 10, 2010
Are we allowed to ask Google Sheets questions in here, because that's where I'm /hoping/ to do this?

Is there a way of saving a formatted block of cells as a sort of blank template, and then have a simple way of adding this block below the previous?

I'm looking to set up a data entry table with a new 'block' for each entry.

e.g

I know I could just do a copy paste for each new block, but for the other users (collaborative doc) something more straight forward and foolproof* would be preferable.
*Particularly with the data validation cells it will have, and I'd like to add some conditional formatting on the full version too.

I was initially hoping Google Forms would work in this way, but the imported data in single straight rows isn't really suitable for the printed reference sheets that I'm hoping for.

Argyle Gargoyle
Apr 1, 2009

ABSTRACT SHAPES CREW

Foreword: I have very little Excel experience beyond the basics.
So an aged coworker asked me to help him out today and I found for him the SUMIF function however we could not get it to operate as desired.


This is the format of the data he will be working with. There can be up to 5 welders on a job maximum but typically there are fewer. New jobs will be added to the list as they are submitted to him.

The goal is to create a column of data entries, one entry per Welder ID, that calculates the average % defects over all jobs on which a particular Welder ID is associated.

I thought that you could simply use =SUMIF(C:G,100,B:B), =SUMIF(C:G,101,B:B), etc. to at least get the total % defects for a given Welder ID over all jobs (and we would cross the next bridge of figuring out how to calculate the average after that) however this only gives the desired result for the first function (Welder ID 100) and not a single other.

Could someone please provide me the function that would accomplish the goal I stated above? I would be very grateful!

Turkeybone
Dec 9, 2006

:chef: :eng99:
Ok, going to try and recreate this without screenshots. edit -- ok I lied, output is below.

So let's make column I your list of Welder IDs, 100 on down. Column J use to sum all the defects. Column K will count all the jobs. Column L just divides sum of all defects by total number of jobs -- you could put all this into a single column/formula once you understand it, if you wish.

Column J is this formula: =SUMIFS(B:B,C:C,I2)+SUMIFS(B:B,D:D,I2)+SUMIFS(B:B,E:E,I2)+SUMIFS(B:B,F:F,I2)+SUMIFS(B:B,G:G,I2)

Where I2 is the Welder ID. This adds up all the defects if the welder ID matches in each of the five columns (I'm sure there is a more elegant way to write this, but eh).

Column K is this formula: =COUNTIF(C:G,I2)

Where I2 again is the welder ID. This just counts the total number of jobs the welder has been involved in.

Column L just divides one by the other to get the Average % defect.




EDIT: Also --- if your data was laid out like below, then you could just throw it into a pivot table and/or do the above with much simpler formulas (just using averageif, not summing and counting).




You could spit out a pivot table such as:



Source: I do this kinda stuff for work, but sum cases of wine sold per salesperon rather than average defects of job per welder. :)

Turkeybone fucked around with this message at 01:22 on Jan 13, 2016

Squashy Nipples
Aug 18, 2007

I was going to fix those formulas for you, but I was beaten due to the outage. :)

SUMIF, SUMIFS, COUNTIF, COUNTIFS and related functions are by far the most useful thing they've added to Excel in a long time (they came in with 2007). You should learn to love them, they are fast, reliable, and generally easier to understand then the previous options, array formulas and database formulas.

But yeah, the REAL answer here is to record your data in more useful format, which will greatly simplify your formulas.

Vaz
Feb 15, 2002
Vurt Refugee
Is there a formula of FV function that amt value is increased by x amt at each y period? Say 36 months and first 12 periods amt is 1000, next 12 1100 and so on.

Argyle Gargoyle
Apr 1, 2009

ABSTRACT SHAPES CREW


Just wanted to report back that this was just what he was looking for and it has been a big help. Thanks!

double nine
Aug 8, 2013

So this is a little out there but I'm trying to get better at excel but lack the inspiration for trying/finding new functionality. Are there good websites with exercises to make myself more of a power user?

Squashy Nipples
Aug 18, 2007

It's getting really long in the tooth now, but Jelen's Guerrilla Data Analysis is a classic, and I use most of the tricks in the book on a regular basis.

http://www.amazon.com/Guerrilla-Analysis-Using-Microsoft-Excel/dp/1615470336/

His website has lots of examples to play around with.

mobby_6kl
Aug 9, 2009

by Fluffdaddy
This is stupid but it's just driving me nuts. What's the best way to convert dates like this:
Dec 18, 2015 5:09:53.0 AM
into an Excel date? I got as far as converting that into "18-Dec-2015" which is supposed to work with datevalue but doesn't.

Squashy Nipples
Aug 18, 2007

mobby_6kl posted:

This is stupid but it's just driving me nuts. What's the best way to convert dates like this:
Dec 18, 2015 5:09:53.0 AM
into an Excel date? I got as far as converting that into "18-Dec-2015" which is supposed to work with datevalue but doesn't.

Assuming that it's in there as text, and you want to truncate the time, then you can just use:

=DATEVALUE(LEFT(A1,10))

C-Euro
Mar 20, 2010

:science:
Soiled Meat
Excel has a function that deletes duplicate entries in a selected area. Is there a function that will instead highlight where duplicate entries in a single column? Have a long list where columns A-C contain info, I'm trying to remove rows where there are duplicate entries in A, but those rows contain info in columns B and C that need to be copied into the single rows for each value in A.

Richard Noggin
Jun 6, 2005
Redneck By Default

C-Euro posted:

Excel has a function that deletes duplicate entries in a selected area. Is there a function that will instead highlight where duplicate entries in a single column? Have a long list where columns A-C contain info, I'm trying to remove rows where there are duplicate entries in A, but those rows contain info in columns B and C that need to be copied into the single rows for each value in A.

Conditional formatting has a "highlight duplicates" feature.

Whale Cancer
Jun 25, 2004

Whats the easiest way to conver to hhmmss?

I need for example 12:30 and 30 seconds am to read 003030 or 00:30:30 and the current cell sent to me says 3030. I tried to change the cell format to hh:mm:ss and it just changes it to 00:00:00.

C-Euro
Mar 20, 2010

:science:
Soiled Meat

Richard Noggin posted:

Conditional formatting has a "highlight duplicates" feature.

That there is! Thanks.

Squashy Nipples
Aug 18, 2007

Whale Cancer posted:

Whats the easiest way to conver to hhmmss?

I need for example 12:30 and 30 seconds am to read 003030 or 00:30:30 and the current cell sent to me says 3030. I tried to change the cell format to hh:mm:ss and it just changes it to 00:00:00.

If formatting the dates isn't giving you what you want, then your "dates" aren't really dates.

In Excel, dates are plain integers, counting the days past since the turn of last century ( 1/1/1900)... and any decimal portion represents the time, as a whole decimal part of a day.

The Excel help file refers to these are Serials Numbers, as follows:

quote:

The DATE function returns the sequential serial number that represents a particular date. For example, the formula

=DATE(2008,7,8)

returns 39637, the serial number that represents 7/8/2008.

Try it yourself: stick the numbers "1", and "2" into two different cells, and then change the cell formats to Short Date. You'll get this:
1/1/1900
1/2/1900

I'm guessing that the problem is that your "times" are whole integers. This means that formatting it for time only (hh:mm:ss) is CORRECT when it displays as "00:00:00".

ShimaTetsuo
Sep 9, 2001

Maximus Quietus
Yeah, the integer 3030 is some day in 1908, at midnight, that's why formatting as h:mm:ss it doesn't help. You can try to parse a string representing a time into a "datetime object" using the TIMEVALUE function. It may not work with your input, or give you the wrong thing depending on locale. In that case, hack out the individual bits (hour, minute, second) with MID or whatever, and plug them into the TIME function. You will be able to format the output from either function into h:mm:ss or whatever you need.

Xenoborg
Mar 10, 2007

Is there a way to sort a spreadsheet by column A, but then also group duplicates of column B together? I've got a list of parts and part locations that it would be really useful to see duplicate parts and/or locations together. At the moment I'm resorting the spreadsheet every group of entries.

DRINK ME
Jul 31, 2006
i cant fix avs like this because idk the bbcode - HTML IS BS MAN

Xenoborg posted:

Is there a way to sort a spreadsheet by column A, but then also group duplicates of column B together? I've got a list of parts and part locations that it would be really useful to see duplicate parts and/or locations together. At the moment I'm resorting the spreadsheet every group of entries.

If you click on the Data tab there's a big Sort button, hit that and you can add levels of Sort By

Busy Bee
Jul 13, 2004
I work in a department with 150 employees divided into four offices around the world. We're a global company and we speak with customers all around the world. Sometimes we have cases we need to take where we need a specific language / region skill. I want to make an Excel sheet where I pull data from the following categories:

1) Office Location
2) Employee Name
3) Day of Hire
4) Shift Hours
5) Days Off
6) Language Skills - English (Native) / Spanish (Advanced) / French (Intermediate) etc.
7) Region Skills - United States / South America / Eastern Asia etc.

With the above information, any of the employees can open the Excel document and say, "I need someone with Spanish skills" "I need someone with knowledge of South America" and once they choose whatever they need, it'll pull up a list of the employees with those specific details.

I will use the #3 data point to show a cell that shows months of experience since day of hire that automatically updates to the current date. I would also like to use the #4 data point to create a cell that shows whether that employee is on shift and if not, how many hours until they will be in office.

How do you suggest I go about this once I gather all the data points from the employees? I am thinking have one tab with all the information, and another tab where it pulls the data from the first tab. Pivot tables?

Busy Bee fucked around with this message at 21:49 on Feb 19, 2016

fosborb
Dec 15, 2006



Chronic Good Poster
Pivot Tables summarize data. Your requirements sound like you just need to filter details.

Select the data, format as table, and teach your users how to filter columns. I don't think there's going to be anything else as far and easy to use.

Busy Bee
Jul 13, 2004

fosborb posted:

Pivot Tables summarize data. Your requirements sound like you just need to filter details.

Select the data, format as table, and teach your users how to filter columns. I don't think there's going to be anything else as far and easy to use.

That makes sense and seems like the easiest option. However, how would I filter some of the sections such as 'Language Skills' and 'Region Knowledge' where there could be multiple choices - there are many employees who speak at least 3 or 4 languages.

ShimaTetsuo
Sep 9, 2001

Maximus Quietus
Don't put those lists in single columns. If you don't have too many languages, make them separate columns like "English", "Spanish", "French", "German", then write levels in each columns like "None", "Basic", "Intermediate", "Advanced". Same for regions, and days off ("Works Monday", "Works Tuesday", ..., "Works Sunday" columns, each is TRUE or FALSE).

Otherwise you're going to have to ctrl+F your way around to finding the people you need. You should also use data validation with a fixed list for the language columns etc. so no one starts writing bogus stuff like "pretty good", "ok", "I took 3 years in HS" that you won't be able to filter correctly. I think you can also force the "date of hire" column to be a real date only (otherwise you will have problems with strings that look like dates but aren't and your "time since hire" computation won't work correctly).

edit: I know it sounds hideous but that's about the best you'll get in Excel without a lot of extra work.

ShimaTetsuo fucked around with this message at 23:59 on Feb 19, 2016

fosborb
Dec 15, 2006



Chronic Good Poster
Oh jesus, didn't realize each person could have multiple specialties, etc. Excel does not handle many-to-one relationships well....

Okay, here's a hack.

Have two drop downs at the top of your page. One is languages and one is regions.

Add two columns to the end of your table with a formula like the following:

=IF(ISERROR(FIND(LanguageDropDownValue,LanguageRowValue)),"DoNotDisplay","Display")

And then filter so that only Display shows.

invision
Mar 2, 2009

I DIDN'T GET ENOUGH RAPE LAST TIME, MAY I HAVE SOME MORE?
I hate myself for asking or even having a reason to ask this question:

Anyone used tcp sockets in VBA to do *very heavily customized* HTTP requests... via SSL?

Sri.Theo
Apr 16, 2008
I have a budget spreadsheet that I would like to do some conditional formatting on.

The first sheet has column A with categories, column B with the budgeted amount in -positive numbers- and then each following column has the actual spending in -negative numbers-.

These have to be in negative numbers as they're drawn from data downloaded from my bank.

What's the correct formula to highlight a cell when the negative number is more than the positive budgeted amount?

Thanks if there's a simple way to do it!

SymmetryrtemmyS
Jul 13, 2013

I got super tired of seeing your avatar throwing those fuckin' glasses around in the astrology thread so I fixed it to a .jpg
I'm transitioning into a position at work where I do more Excel manipulation than anything, mainly for retail report analysis. I've been able to solve most of my problems with a combination of cursory VBA knowledge, intuition, and Google (mainly Google). I'm having trouble coming up with a method for doing the following, though:

I need to import 1-3 workbooks, each of which has exactly four worksheets that are named identically. I want to copy the data from each worksheet in each source workbook into the respective worksheet in my pivot table sheet, which I have already set up to do what I want to do. The files aren't named identically, but they follow a certain pattern; that said, I would prefer using a form (which I've already created, and which works to copy the actual sheets into the target sheet). However, instead of copying the sheets, which results in duplicated sheets if I import more than one file, I'd like to copy the data from each sheet (except for the header row) and append it to the respective sheet in my target workbook. They always have the same columns, though they vary depending on which worksheet it is; what I mean is that sheet 1 from any of the books is the same as any other sheet 1, and likewise for the other sheets.

In short, I want to append all rows from Sheet 1 in Books 1-3 to Sheet 2 in Master Book, and likewise for Sheet 2, Sheet 3, and Sheet 4. I want to ignore the header row, but otherwise grab everything.

This snippet seems to work, given target books that only consist of one sheet apiece:

code:
Sub CopyData()
Dim wb1 As Workbook
Dim wb2 As Workbook

'Set workbooks
Set wb1 = Workbooks.Open("c:\Path\of\your\file.xlsx")
Set wb2 = Workbooks.Open("c:\Path\of\your\file1.xlsx")

'Copy data from wb1 sheet 1 to sheet 1 in wb2
With wb1.Sheets(1)
.UsedRange.Copy wb2.Sheets(1).range("A1").end(xldown).offset(1,0)
End With

End Sub
How do I make that loop through multiple user-selected sheets with a button to choose files to import?

What I'm using for the "Copy files" button, which currently copies all sheets from the selected workbook(s) into the current workbook:
code:
Private Sub CopySheetsButton_Click()
    Dim filename As Variant
    Dim wb As Workbook
    Dim lastUsedRow As Range
    
On Error GoTo ErrMsg

    Application.ScreenUpdating = False

    Set thisSheet = ThisWorkbook.ActiveSheet
    
    For i = 0 To FilesListBox.ListCount - 1
        filename = FilesListBox.List(i, 0)
        'Open the spreadsheet in ReadOnly mode
        Set wb = Application.Workbooks.Open(filename, ReadOnly:=True)
        
        'Copy each sheet from the opened spreadsheet
        For Each Sheet In wb.Sheets
            Sheet.Copy After:=ThisWorkbook.ActiveSheet
        Next Sheet
    Next i
    
    ThisWorkbook.Save
    Set wb = Nothing
    
    #If Mac Then
        'Do nothing. Closing workbooks fails on Mac for some reason
    #Else
        'Close the workbooks except this one
        Dim file As String
        For i = 0 To FilesListBox.ListCount - 1
            file = FilesListBox.List(i, 0)
            file = Right(file, Len(file) - InStrRev(file, Application.PathSeparator, , 1))
            Workbooks(file).Close SaveChanges:=False
        Next i
    #End If
    
    Application.ScreenUpdating = True
    Unload Me
ErrMsg:
    If Err.Number <> 0 Then
        MsgBox "There was an error. Please try again. [" & Err.Description & "]"
    End If
End Sub
Thanks for any help you can provide. I'm kind of lost here. I feel like I'm grasping in the right direction, at least.

SymmetryrtemmyS fucked around with this message at 23:40 on Feb 29, 2016

Richard Noggin
Jun 6, 2005
Redneck By Default

Sri.Theo posted:

I have a budget spreadsheet that I would like to do some conditional formatting on.

The first sheet has column A with categories, column B with the budgeted amount in -positive numbers- and then each following column has the actual spending in -negative numbers-.

These have to be in negative numbers as they're drawn from data downloaded from my bank.

What's the correct formula to highlight a cell when the negative number is more than the positive budgeted amount?

Thanks if there's a simple way to do it!

In Conditional Formatting, select "Use a formula...", then use this for the formula:
code:
=ABS($B1)>$A1
where $B1 is the first negative cell, and $A1 is the first positive cell.

Squashy Nipples
Aug 18, 2007

invision posted:

I hate myself for asking or even having a reason to ask this question:

Anyone used tcp sockets in VBA to do *very heavily customized* HTTP requests... via SSL?

Hmmmmmm. I'm not sure. Windows provides an HTTP Object for you to use, and I've done a lot of web-scraping with it, but I don't know if it supports SSL.


SymmetryrtemmyS posted:

I'm transitioning into a position at work where I do more Excel manipulation than anything, mainly for retail report analysis. I've been able to solve most of my problems with a combination of cursory VBA knowledge, intuition, and Google (mainly Google). I'm having trouble coming up with a method for doing the following, though:

I need to import 1-3 workbooks, each of which has exactly four worksheets that are named identically. I want to copy the data from each worksheet in each source workbook into the respective worksheet in my pivot table sheet, which I have already set up to do what I want to do. The files aren't named identically, but they follow a certain pattern; that said, I would prefer using a form (which I've already created, and which works to copy the actual sheets into the target sheet). However, instead of copying the sheets, which results in duplicated sheets if I import more than one file, I'd like to copy the data from each sheet (except for the header row) and append it to the respective sheet in my target workbook. They always have the same columns, though they vary depending on which worksheet it is; what I mean is that sheet 1 from any of the books is the same as any other sheet 1, and likewise for the other sheets.

In short, I want to append all rows from Sheet 1 in Books 1-3 to Sheet 2 in Master Book, and likewise for Sheet 2, Sheet 3, and Sheet 4. I want to ignore the header row, but otherwise grab everything.

This snippet seems to work, given target books that only consist of one sheet apiece:



How do I make that loop through multiple user-selected sheets with a button to choose files to import?

What I'm using for the "Copy files" button, which currently copies all sheets from the selected workbook(s) into the current workbook:

Thanks for any help you can provide. I'm kind of lost here. I feel like I'm grasping in the right direction, at least.


I'm not sure I understand your quandary, but here is some random advice:

-Don't use a WITH statement for only one line.

code:
'Copy data from wb1 sheet 1 to sheet 1 in wb2
With wb1.Sheets(1)
.UsedRange.Copy wb2.Sheets(1).range("A1").end(xldown).offset(1,0)
End With

'Copy data from wb1 sheet 1 to sheet 1 in wb2
wb1.Sheets(1).UsedRange.Copy wb2.Sheets(1).range("A1").end(xldown).offset(1,0)
-Don't bother turning off ScreenUpdating

Some people might argue this point, but it no longer saves much time, and can occasionally cause bugs under various combinations of Win7+ / MSO 2013 +
I've stopped using it entirely.


-It's better to set up your UserForms as a specific Object from the calling code, and load and unload it from the main code (don't use "Unload Me")


code:
Dim ufoDatePicker As ufDatePicker

    Set ufoDatePicker = New ufDatePicker 'this runs the "UserForm_Initialize()" code block
    
    ufoDatePicker.Show 'shows form and switches control over to form
    
    'goes off and runs the UserForm code, returning here when it hits a "me.hide"
    
    Unload ufoDatePicker 'deletes UserForm Object from memory
This is another one of those opinion things, but I've done some complicated work with UserForms, and doing it this way helps me keep them straight.
"uf" refers to the UserForm Class, and "ufo" refers the specific UserForm Object

And Finally,
-Use a LONG variable to track the current row (I often use "lngRow")

I'm unfamiliar with your use of "UsedRange". Looks like it works, but I always specify a RANGE using specific Columns and a Row variable.
Something like this:

code:
Sub CopyData()

Dim lngSourceRow As Long
Dim lngDestRow As Long

Dim wbDest As Workbook
Dim wbSource1 As Workbook
Dim wbSource2 As Workbook
Dim wbSource3 As Workbook

    'Set workbooks
    Set wbDest = Workbooks.Open("c:\Path\of\your\file1.xlsx")
    Set wbSource1 = Workbooks.Open("c:\Path\of\your\file2.xlsx")
    Set wbSource2 = Workbooks.Open("c:\Path\of\your\file3.xlsx")
    Set wbSource3 = Workbooks.Open("c:\Path\of\your\file4.xlsx")
    
    'Copy first sheet (INCLUDE HEADERS)
    lngDestRow = 1
    lngSourceRow = wbSource1.Worksheets(1).Cells(Rows.Count, 1).End(xlUp).Row
    
    wbSource1.Worksheets(1).Range("A1:G" & lngSourceRow).Copy Destination:=wbDest.Worksheets(1).Range("A1")
    
    'Copy Second sheet (NO Headers)
    lngDestRow = lngDestRow + lngSourceRow
    lngSourceRow = wbSource2.Worksheets(1).Cells(Rows.Count, 1).End(xlUp).Row
    
    wbSource2.Worksheets(1).Range("A2:G" & lngSourceRow).Copy Destination:=wbDest.Worksheets(1).Range("A" & lngDestRow)
    
    'Copy third sheet (NO Headers)
    lngDestRow = lngDestRow + lngSourceRow
    lngSourceRow = wbSource3.Worksheets(1).Cells(Rows.Count, 1).End(xlUp).Row
    
    wbSource3.Worksheets(1).Range("A2:G" & lngSourceRow).Copy Destination:=wbDest.Worksheets(1).Range("A" & lngDestRow)
    

End Sub
Hope that helps.


EDIT: I didn't test any of that code, it might need some tweaking.

Squashy Nipples fucked around with this message at 22:53 on Mar 1, 2016

Methanar
Sep 26, 2013

by the sex ghost
I've got a spreadsheet that calculates the expected bandwidth on some links and I'd like to try and find out the appropriate fractional T1 bandwidth I would need to accomodate each link. What would be an appropriate way of doing this?

When you buy T1 bandwidth you buy it in channels of 64kbps blocks. Serial links run into some serious diminishing returns regarding queuing latency when they are utilized beyond 75%. So I want to try and find the smallest number of T1 channels that I would need to purchase to satisfy a bandwidth that is large enough that the expected load does not exceed 75%. I have no idea how I would write a formula to do this for me.

Just for example purposes I did one link by hand. I divided 624/.75 to find the T1 bandwidth I would need and then I trial and errored different numbers in x*64 until I found a number of channels that provided equal or greater bandwidth than my requirement.

I was thinking about writing a macro that would iterate through values of X until it found a value greater than a cell relative to where the macro was applied, but I have no idea how to do that either.

tuyop
Sep 15, 2006

Every second that we're not growing BASIL is a second wasted

Fun Shoe
Crossposting from the A/T thread because I don't even know what to google to figure this out, so I'm just kind of looking for a starting point:

Hey excel wizards, I have a question about making a crappy implementation tolerable:

So every day here we have to track how many gewgaws we give each client. So like, client a takes a gewgaw on Monday and Wednesday, client b takes one on Tuesday.

We currently have a spreadsheet with like client a and client b in column a then dates from columns b-ak. Then we just total at the end with a sum function.

The problem is that we have like 200 clients a month and it becomes unwieldy to figure out on like day 24 whether a client is new and then add more gewgaws to their tab. We also don't have MS Access or any other DB software.

Is there any way in excel or any other program to like check to see if a client is currently in the sheet and add to their tab if so and create a new entry if not?

We currently just ctrl+f through the document to identify regular vs. new clients, but it's really time consuming and annoying. The objective is to just get a total of each client's gewgaws each day (time stamped by day) and predict somehow how many gewgaws they'll take and cut them off if needed.

Duplicates are fine as long as the data still produces usable gewgaws per day and total gewgaws used.

ShimaTetsuo
Sep 9, 2001

Maximus Quietus

Squashy Nipples posted:

Hmmmmmm. I'm not sure. Windows provides an HTTP Object for you to use, and I've done a lot of web-scraping with it, but I don't know if it supports SSL.

It's in a COM library that comes with Windows (I think?) and is called WinHTTP. As far as I know it does support it but I've never used that feature.


Methanar posted:

I've got a spreadsheet that calculates the expected bandwidth on some links and I'd like to try and find out the appropriate fractional T1 bandwidth I would need to accomodate each link. What would be an appropriate way of doing this?

When you buy T1 bandwidth you buy it in channels of 64kbps blocks. Serial links run into some serious diminishing returns regarding queuing latency when they are utilized beyond 75%. So I want to try and find the smallest number of T1 channels that I would need to purchase to satisfy a bandwidth that is large enough that the expected load does not exceed 75%. I have no idea how I would write a formula to do this for me.

Just for example purposes I did one link by hand. I divided 624/.75 to find the T1 bandwidth I would need and then I trial and errored different numbers in x*64 until I found a number of channels that provided equal or greater bandwidth than my requirement.

I was thinking about writing a macro that would iterate through values of X until it found a value greater than a cell relative to where the macro was applied, but I have no idea how to do that either.



I don't know anything about T1 bandwidth, but from your description 13 T1 channels would result in 13*64 =832 kbps. Your total link traffic is 624.6 kbps, which as a proportion of the total available is 75.072% > 75%. Shouldn't you need 14 then?

You can get to this value by using the ceiling function: = CEILING(624.6/0.75/64, 1). Basically, find the exact (decimal) amount of channels you would need, then round up to the next smallest integer.

ShimaTetsuo fucked around with this message at 01:54 on Mar 2, 2016

Methanar
Sep 26, 2013

by the sex ghost

ShimaTetsuo posted:

It's in a COM library that comes with Windows (I think?) and is called WinHTTP. As far as I know it does support it but I've never used that feature.


I don't know anything about T1 bandwidth, but from your description 13 T1 channels would result in 13*64 =832 kbps. Your total link traffic is 624.6 kbps, which as a proportion of the total available is 75.072% > 75%. Shouldn't you need 14 then?

You can get to this value by using the ceiling function: = CEILING(624.6/0.75/64, 1). Basically, find the exact (decimal) amount of channels you would need, then round up to the next smallest integer.

Yes I would. I omitted the decimal when I did that, another reason to make the computer do it for me.

Your formula works perfectly. I subbed in the cell number for 624 and Excel's pattern sensing filled in the rest for me.

Adbot
ADBOT LOVES YOU

Turkeybone
Dec 9, 2006

:chef: :eng99:

tuyop posted:

Crossposting from the A/T thread because I don't even know what to google to figure this out, so I'm just kind of looking for a starting point:

Hey excel wizards, I have a question about making a crappy implementation tolerable:

So every day here we have to track how many gewgaws we give each client. So like, client a takes a gewgaw on Monday and Wednesday, client b takes one on Tuesday.

We currently have a spreadsheet with like client a and client b in column a then dates from columns b-ak. Then we just total at the end with a sum function.

The problem is that we have like 200 clients a month and it becomes unwieldy to figure out on like day 24 whether a client is new and then add more gewgaws to their tab. We also don't have MS Access or any other DB software.

Is there any way in excel or any other program to like check to see if a client is currently in the sheet and add to their tab if so and create a new entry if not?

We currently just ctrl+f through the document to identify regular vs. new clients, but it's really time consuming and annoying. The objective is to just get a total of each client's gewgaws each day (time stamped by day) and predict somehow how many gewgaws they'll take and cut them off if needed.

Duplicates are fine as long as the data still produces usable gewgaws per day and total gewgaws used.

It sounds like you'll need to use some combination of sumif/averageif to streamline your gewgaw tracking, and maybe some conditional formatting to highlight new clients vs a static list, something like that. If you are willing to sanitize a bit of your gewgaw tracker and want to send me an excel file to look at, send me a PM.

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