Keep Rows Number In Table Consistent

Jan 4, 2007

I have 3 columns of data "Store", "Week" and "Cust" and use the code below to ensure that it was always 150 consecutive rows long regardless of whether any data is in the row.

This is fine if I just have one week to sort, but I find I now have 52 weeks of data and each week could have a different number of stores. I just need the macro below to run each time a new week starts. I can easily put a space (or something else) at the start of each new week so that a " loop" can check for it.

For i = 1 To 150
If ActiveSheet. Cells(i, 1).Value <> i Then
ActiveSheet.Rows(i).Insert
End If
Next

View 4 Replies


ADVERTISEMENT

Convert Human-readable Text Strings Into Consistent Number Of Weeks From Today Date?

Dec 17, 2011

Is it possible to do the following with a formula in Excel...

I have a list of users with the dates they first logged into a system and the date they last logged in. I'm trying to group them together into segments so I can analyse them using a Pivot table and chart to see how often different groups are using the system, e.g. New customers in December, November, October, etc.

The trouble I am having is trying to convert the different human-readable text strings into a consistent number of weeks from today's date, e.g.

USER FIRST LOGGED IN LAST LOGGED IN
user 1 2 years 20 weeks 54 sec ago
user 2 44 min 7 sec 1 min 37 sec ago
user 3 49 weeks 2 days 17 min 3 sec ago
user 4 5 weeks 2 days 33 min 32 sec ago
user 5 38 min 9 sec 38 min 9 sec ago
user 6 5 weeks 3 days 1 hour 7 min ago
user 7 2 hours 17 min 2 hours 11 min ago
user 8 45 seconds ago 45 seconds ago

Is there a formula I can use to convert these human readble text strings into a number of weeks elapsed since today's date?

View 9 Replies View Related

Delete Number Table Rows Using VBA

Jul 19, 2013

Im trying to use VBA to copy old entries from a table on one sheet, to a history table on another sheet once they have been there for two weeks.

That much has been accomplished. However, I would also like the old entries to be removed from the original table.

Each entry is numbered using the following method:

If text is entered into the second column in a row, excel takes the number of the entry before that, adds 1 and places this number in a column outside of the table. The first column of each row then references this number. This way your entry is numbered as soon as you type it in. The reason I referenced outside the table and did not type the formula in the first column directly is because when I did and excel deleted a row through visual basic it messed up the rest of the table. Referencing outside fixes that problem, but there is another.

I have several columns for conditional formatting to the right of my table, full of 1s and 0s. When a row gets deleted in the table, all remaining rows shift up but continue to conditionally format based on the cells they were originally along side of. The problem is, those cells recalculate for the row in the table that is now along side of it.

Is there any way I could make the formulas in those columns evaluate only once and to not re-evaluate once something has moved?

View 2 Replies View Related

VBA Pivot Table With Unspecified Number Of Rows?

Mar 21, 2012

I'm new to using VBA and have been recording macros and then trying to edit them where I need to and using Google to get the answers that I need, however I have hit a snag when I create a pivot table using my current macro.

The data sheet that I am creating my Pivot Table from will always have a different number of rows from week to week, but I am unsure of how to code this into my macro. When I recorded this, I used the range A1:S10000, which gives me (Blank) as the last row in my pivot table. change my code so that it only selects the data rows to stop these blanks appearing?

Code:

'Pivot Table DATA Tab to show Call Out Times for all Centres in file
ActiveWorkbook.PivotCaches.Add(SourceType:=xlDatabase, SourceData:= _
"DATA!R1C1:R10000C19").CreatePivotTable TableDestination:= _
"PIVOT!R3C1", TableName:="PivotTable1", DefaultVersion:= _

[Code]....

View 5 Replies View Related

Counting Same Id In Rows And Sum Number Of Hours For Id In Pivot Table?

Jun 26, 2012

I have a column C which list Unique ID and this ID can be repeated several times in Column C. For each row the Unique ID has a value in Column D of how many sick hours are taken. I would like to create a pivot table which would provide a count of the Unique IDs and the total number of hours for the Sector in Column A.

Q1_Sick UnCertified 01042012_25062012(1).xls

View 10 Replies View Related

HLookup - Return Correct Number Of Rows Downwards In Table?

Feb 8, 2013

=HLOOKUP(G8,'Headline Assumptions'!$C$32:$F$37,E8,FALSE)

Above formula, in cell E8 is the number 3, however excel does not recognise this and returns 1. is there a way i can get E8 to see that it is a 3 in that cell and return the correct number of rows downwards in my table?

View 1 Replies View Related

Consistent Layout

Feb 28, 2009

I have MS Office 2003 with Excel and am comfortable creating formulas and have fun making spreadsheets, but have little experience with multiple tabs. They frustrate me. I'd like to set up a file that would essentially be a year of bookkeeping. Everything in view would be income, outgo, anticipated expenses, and running cash flow for a month. I'd like 12 or 14 tabs (1 per month plus overview and recap capability). If I make any format changes in row height or column width, I'd like those changes to apply to all tabs without having to copy the new layout to each of the other tabs. I think that would run the risk of also copying one months expenses/income erroneously to another month. Is this possible? I'd like to stretch a column, add column or row and have the changes apply to all tabs.

Also, most of the time, I like to have a tinted background behind my lists, but if a cost item needs to be copied from a green "expense list" to a blue "accounts paid" list, the color comes along. Can I copy only the text, not the format?

View 6 Replies View Related

Sum Data That Is Not Consistent & Changes

Aug 31, 2006

i have attached a sample spreadsheet that i am having a real problem with. each period i have to produce a report showing the week and period-to- date figures for various sites. the info is held in Adaytum and a view is created in excel that pulls in the data. i then run various formulae to create the report.

the cells in blue are a linked view from Cognos/Adaytum (an external database program). the cells in green contain a SUMIF formula that works correctly until the Adaytum view is changed, whereupon all formula with cell references within the blue area turn to REF#. don't ask me why, it seems to be a quirk of this version of Adaytum i use

so, in the example attached if i change from period 06 to period 07 in the Adaytum view, my criteria cells (B2:E2) would go to REF# and the green cells (J5:J8) go to REF# also.

the only way i have found to get around this is to use a vlookup, and extend the lookup range beyond the blue cells, ie. =VLOOKUP($H5,$A$5:$F$8,2,0). for some reason this works!

now, for a single weeks info this works ok, as the lookup is referencing a single offset column but i can't think of a way of then saying, "do the lookup and then sum columns B+C, or B+C+D"

does anyone have any ideas how this might work? can the Sum or Offset functions be used within a Vlookup?

View 9 Replies View Related

Division Formula Not Consistent

Nov 9, 2009

In the attached file I am simply trying to get a percentage for a given group based on the column "annual starts". When I try and copy down the formula for the other cells it gives me an error because its using the wrong denominator (the errors show up in the excel sheet as #div/0).How can I make this consistent?

View 2 Replies View Related

VBA Not Following Consistent Rounding Rules?

Jun 13, 2014

This Subroutine:

[Code] .........

Seems to behave differently each time it is called from my main Loop. As an example the first loop finds:
TotalTubes = 6
TubeRows = 4
TopRowTubeCount = 2
Where 6/4 = 1.5 and is rounded up to 2

The controlling variable in my code for Length is TopRowTubeCount and it is a Public Variable Dimensioned as an Integer

However on the next loop it finds:
TotalTubes = 210
TubeRows = 4
TopRowTubeCount = 52
Where 210/4 = 52.5 and is rounded down to 52?

I even used the round function for the TopRowTubeCount calculation and the erratic behavior continues.

View 3 Replies View Related

Consistent Decimal Places

Nov 30, 2006

Is it possible to apply some kind of formatting to a range, that will force all numbers entered into that range to have the same number of decimal places as the cell with the maximum number of decimal places?

View 9 Replies View Related

Assign Consistent Letter Value To Grade Percentage

Oct 9, 2008

Newbie here. I have a very frustrating problem. I am using excel for my gradebook at school. I've tried several different ways to assign a letter grade to an number average. It works fine each different way I do it, VLOOKUP, IF, etc. But, I have about 5 grades out of 100 which give the wrong letter grade. For instance, my scale says that a grade of 85 should be lowest limit of a "B", but I get a "C" returned in the cell instead. Like I said, it only happens on a few grades. The biggest majority work fine. I can't figure out why. Any ideas? Attached is one of the "problems" with a student's grades. Note the Final Avg with a grade of "C", it should be "B".

View 12 Replies View Related

Rotate Range, Keep Defined Names Consistent.

Dec 1, 2009

as the title says, i need to rotate a range but to keep all defined names (single cell or range) consistent.

i.e.
lets say i have the following cells filled:

1 2 3 4
1 2 3 4
1 2 3 4
1 2 3 4
1 2 3 4
1 2 3 4
1 2 3 4
now i have a few defined ranges. lets say:
range name, refers to
mycell1row1, A1
mycell90roanything, B1
mysomething, C1
mysomthingrange, A1:F1

etc.

what i need in the end is this:

1 1 1 1 1 1 1
2 2 2 2 2 2 2
3 3 3 3 3 3 3
4 4 4 4 4 4 4
and for defined names:
mycell1row1, A1
mycell90roanything, A2
mysomething, A3
mysomthingrange, A1:A7

View 9 Replies View Related

Lookup #N/A! Error: Copy And Consistent Throughout The Sheet

Jan 11, 2007

I cannot determine why I am getting an N/A error in Cells I11:L11. The formula is copied and consistent throughout the sheet. The Table referenced in the formula appears to be fine. I just cannot figure this out.

View 5 Replies View Related

Excel 2003 :: Get Dates To Remain In Consistent Format

Apr 11, 2012

I have been struggling to get dates to remain in a consistent format within my Excel 2003 worksheets. I would like to work out how to keep them permanently in the "dd/mm/yyy" format. I have tried several formatting options. The current method I will explain below:

I have several forms into which the 'date' is automatically entered using the - Format(Date, "dd/mm/yyyy") code. This is then saved into cells on a worksheet using the code

ws.Cells(iRow, 1).NumberFormat = "dd/mm/yyyy"
ws.Cells(iRow, 1).Value = CDate(Me.Date1.Caption)

At this point if I do a search for a date, lets say 23/03/2012 I can retrieve it and everything related to it - all seems fine (also all dates are visually in the correct format in my cells etc).

The problem arises when I exit Excel and save the workbook. When I go back into the workbook at a later time and try and search for the same date it won't work. Although the dates in the cells still read for example 23/03/2012, the search requires me to now use the format 03/23/2012 to retrieve the information (It seems like in the background the date has reverted to the US date format upon saving and yet visually it is still how I've set it up).

View 1 Replies View Related

Gross Margin Formula That Maintains Consistent Markup Price Across Varying Costs

Jan 8, 2014

So I can easily put together a formula that maintains a consistent markup price across varying costs. Is there a formula that will give me a consistent gross margin % as I drag down a series of costs?

So if the cost is 158 a 42% mark up would be 224.36 but the Gross Margin % is only 29.58. I want to be able to hit a 42% mark up across the board.

View 5 Replies View Related

Find Largest Invoice For Each Individual Identifying Code Number In The Table Without Using A Pivot Table

Sep 8, 2009

Data Table including-

List of Identifying Code Numbers for customer invoices

Multiple repetitions of individual Identifying Code Numbers in list

Various data in table range including Various Values of invoices from different dates for each repetion of Identifying Code Number.

- Wish to find largest invoice for each Individual Identifying Code Number in the table without using a pivot table.

i have tried combining Max and Large functions with Vlookups etc.

View 9 Replies View Related

Convert The Data Shown In Table 1 To Table 2 Without Rearranging The Columns And Rows

Sep 11, 2009

Is there a function to convert the data shown in table 1 to table 2 without rearranging the columns and rows? because i don't want to use TRANSPOSE. I want a function, somthing like SUMIF with OFFSET or INDEX and MATCH or any other function.

Table 1

Team 1Team 2Team 3Team 4Team 4Team 5Team 5ABABCity 12531642City 231173705City 367891125City 436251348

Table 2

City 4City 2City 1City 3Team 4BTeam 2Team 5ATeam 4ATeam 1Team 3Team 5B

View 2 Replies View Related

Transfer Data Table 1 To Table 2 Change Rows To Column?

Mar 13, 2013

Table 1
January-12
February-12
March-12

Table 2

Sr. No
Name
Dep
Lates
CL / SL
AL
Lates
CL / SL
AL
Lates
CL / SL
AL

[Code].....

View 1 Replies View Related

Error In Filtering Table - Additional Rows Shown / Rows Hidden When Filter Removed

Mar 4, 2014

I have an excel file with a table in it. It contains 2051 records (attached). This is just a sample, the original file has around 30,000 rows.

When I start using filters, I run into problems:

Step 1: Filter by Unit, condition (e.g.) Unit_23
Excel shows in the status bar the following message: 437 of 2050 records found.

Step 2: If I scroll to the bottom of the table, the row numbers are colored in blue (normal for a filtered list) however the last row is not colored and it actually should not be shown since its unit is not what I filtered for (its unit is Unit_25)

Step 3: Clear the filter of Unit

Step 4: Sometimes (depending on what I filter for), one or more of the bottom rows are hidden!!!

Attachment 301726

View 4 Replies View Related

Insert Group Header Based On Consistent Value Within The Group?

Feb 10, 2014

I have several groups of data in the same sheet. Each group has two blank rows above the first row of data. Each group has column "B" in common (e.g., "Phone" in the example attached). I'd like to add a title/label of "Phone" to the first column in the row immediately preceding the first row of data for that group.

View 1 Replies View Related

Macro For Spreadsheets With Different Number Of Rows And Constant Number Of Columns?

Mar 1, 2014

I work on a daily basis with spreadsheets in excel. The number of columns is the same, but every single spreadsheet has a different number of rows. I recorded this macro in a table with 1196 rows and I would like to use this macro also in other tables with a different number of rows.

Sub City2()
'
' City2 Macro
'

'
Selection.Copy
Cells.Replace What:="POMPANO", Replacement:="Pompano Beach",

[Code].......

View 12 Replies View Related

Excel 2010 :: Extend Rows Based On The Number Of Rows In Another Sheet

Jun 16, 2014

calculate the number of full rows in one data base located on one sheet X to determine how many rows the macro needs to extend on sheet B (sheet B is made only of formulas for data interpretation in sheet A.

View 14 Replies View Related

Maro, Insert Rows Where Rows Determined By Number Of Carriage Returns

Feb 17, 2010

The best way to explain my problem is to look at the table below:

How it looks now: ApplePrice 1
Price 2
Price 3FruitDeliciousPearStore 1
Store 2FruitVery DeliciousHow I want it to look:ApplePrice 1FruitDeliciousApplePrice 2FruitDeliciousApplePrice 3FruitDeliciousPearStore 1FruitVery DeliciousPearStore 2FruitVery Delicious

View 9 Replies View Related

VBA To Number Rows In A Column But Starting From Specific Number

Mar 10, 2014

I would like to create a vba script when ran an input.box comes up and asks you to "enter number you want to start numbering from" and when the number is entered in the input box. e.g "7654", excel starts numbering each cell in column A from 7654 until there is an empty cell in column B.

View 7 Replies View Related

Count Number Of Rows That Have Particular Rows

Oct 9, 2009

I would like to count the no. of rows that has "Evolution" in column 8. Just a msg box to display would help.

View 8 Replies View Related

Write A Number In Table

Jun 28, 2009

I am having some trouble setting up an excel spreadsheet. I dont know alot about this kind of thing so if it comes out confusing i apologise.

what i need to do is the following:

1. I need to have a cell which holds a range of data for example between 7.5 and 7.99, then the next cell 8.0-8.49 etc. How would I go about doing this?

2. I then have 2 tables side by side. on the first table i want to be able to write a number in, say 7.6, and once i enter this number i need in the second table for it to have sorted which of the above fields it fits into. I know you can have colours for each field, and that is the way i would identify which data range it fell into.

View 12 Replies View Related

Enter A Number From A Table

Apr 21, 2006

I am working on a spreadsheet and I want to enter a number from a table and
have the associated values from the table transfer with the number into my
spreadsheet. What functions and formulas should I use? (Below is the Table,
the PTM# is the one I would query for.)

X L/R Y PTM#
0.54R0.5820
0.82R0.5021
0.66R0.7322
0.06L0.2723
0.03R0.1324
0.55R0.2925

View 10 Replies View Related

Number And Highlight New Row In Table

Apr 24, 2008

I'm trying to create an audit log worksheet on the different steps taken to resolve a problem e.g

1 fill kettle with water
2 plug kettle in

etc, etc.

What I would like is for each new row to be entered the number of row is automatically displayed and for the contents of this row to be either in a different coloured font or have a coloured pattern.

I would also like that at the end of each row completed a command button is pressed to return the cursor to the new row and provide the above. Ideally, the row just completed should return back to a normal coloured font or have the pattern removed.
I presume this would require nested if statements within the command button but unfortunately its far too complicated for my excel skills.

View 2 Replies View Related

Add Zero-value Rows To Table

Jun 7, 2007

The data I am trying to work with has 3 columns:
Date
Hour (1-24)
Value (number measured for the hour)

The DBase only records a time/hour stamp/value when there is a non-zero value. So, when I sort the data, I have hours/days missing.

What I want to do is add rows in Excel such that there is 24 rows per day and 30(or 31) days per month. Most people are trying to DELETE these zero rows, not add them, so I haven't found any help on this.

View 6 Replies View Related







Copyrights 2005-15 www.BigResource.com, All rights reserved