Vba Fill In From Cell Above Over 2 Worksheets
Jan 14, 2010
I'm looking at filling in a cell value from the cell above in column A but over a range of worksheets. It only needs to fill down until the last used row.
The last used row in the worksheet will vary for each worksheet .. but the longest column will be column T or U.
this code "works" but only for the active sheet... i'm sure its something easy to adjust.
Sub CopyDataDown()
' ---
Dim ws As Worksheet
Dim Lr As Long
Application.ScreenUpdating = False
For Each ws In ActiveWorkbook.Worksheets
If ws.Name "Notes" _
And ws.Name "FrontSheet" Then
Lr = WorksheetFunction.Max(Range("T" & Rows.Count).End(xlUp).Row, Range("U" & Rows.Count).End(xlUp).Row)
With Range("A2:A" & Lr)
.SpecialCells(xlCellTypeBlanks).FormulaR1C1 = "=R[-1]C"
.Value = .Value
End With
End If
Next ws
Application.ScreenUpdating = True
End Sub
View 9 Replies
ADVERTISEMENT
Aug 23, 2007
I am trying to write code that will loop through one sheet, fill an array and then use that array to populate cells in another sheet. I have a sheet with group names in column A, then in column B through Column IV there are the members of that group. There may be no members in a group or every cell through Column IV could contain data. I need to loop through each row, one at a time, see if a cell contains data, if it does, put it in the array, if it's empty then the array is done for that row. I then need it to go to another sheet and dump that data, however, now it needs to drop it in five consecutive cells in a row, then drop to the next row for the next five cells, etc.
Once this is done it then goes back to the first sheet, drops to the next row nad starts over.
I know how to loop through the rows, I just am not sure how to fill an array using variables for rows and columns. i.e., I can't say fill array with b1 to b30 instead I have to say fill array with intRow,intFirstColumn through intRow, intLastcolumn.
View 6 Replies
View Related
Aug 24, 2007
I have a combobox that I populate this way:
' Sets Names in ComboBox1 Contents
With Worksheets("Sheet1")
Set rng = .Range(.Cells(1, "A"), .Cells(Rows.Count, "A").End(xlUp))
End With
With ComboBox1
.RowSource = rng.Address(external:=True)
End With
What I have are 4 sheets one of which has 3 columns that I need to combine into one "Master" drop down, is that possible?
Sheet1 - Column A
Sheet2 - Column A, B and C
Sheet3 - Column A
Sheet4 - Column A
View 3 Replies
View Related
Aug 1, 2008
I have created a spreadsheet that I must fill out daily. this worksheet has averages that must be automtically shared with a "master" worksheet.
for example
information from sheet2!b23
information from sheet3!b23
information from sheet4!b23
etc...
must automatically be transfered to
sheet1!c6
sheet1!c7
sheet1!c8
etc...
in that order
at this time I am typing in =sheet2!b23 on sheet1 everytime, I want to avoid this.
If you are asking yourself why? I dont blame you but it needs be this way so I can average each days spreadsheet.
View 5 Replies
View Related
Oct 7, 2008
The bright colors work well, but when they print the sheet on a laserjet black/white printer, the colors make the data almost impossible to read.
Is there a way to allow them to print the sheets and, by default, not print the background fill colors?
View 3 Replies
View Related
Nov 11, 2009
Is there a way to enter data into a cell and it would auto fill the Header and Footer in all worksheets? Maybe an embeded marco in the worksheet "TOOLS"?
View 6 Replies
View Related
Feb 10, 2010
I have 2 sheets in the same workbook (sheet 1 & 2) with one matching column (A) of info and need them to combine and fill the missing data. Each sheet has identical column heading and the amount of data is not the same; sheet 1 has ~2000 rows and the other ~5000. Sheet 1 is consolidated so I would like to fill in the missing cells from sheet 2.
Ex. Sheet 1.......
Ex. Sheet 2.....
As you can see, the missing cells in sheet 1 could be filled from the data in sheet 2; also note that the above info is on different rows (and will be random for each case). I only want the columns to fill in that have a matching email, the other 3000 rows in sheet 2 do not match with sheet 1 and I don't want the rest of it to transfer over.
View 4 Replies
View Related
Jul 4, 2012
I have a workbook that has a "summary sheet" and then forty some sheets thereafter. Each row on the summary sheet represents a sheet in the workbook. For instance, i.e. on the worksheet tabs below it is displayed left to right as follows: "summary page"(sheet1), "aaa"(sheet2), "bbb"(sheet3), "ccc"(sheet4) etc. On the summary page, row one identifies the aggregate of sheets in a horizontal fashion, i.e. cell A1: "aaa"; cell A2: "bbb" and cell A3: "ccc" etc. I am pulling data for various parameters as columns on the summary page relative to each row (representing each sheet) via "SUMPRODUCT" and "COUNTIF" formulas. The formulas are a constant as each sheet's rows and columns are identical, the only variable in a given formula is the sheet name.
For example: =COUNTIF('aaa'!$C$4:$C$16,"Online")
This works fine if I drag and auto fill the column on the summary sheet, except for the fact that I have to manually type in: 'bbb' in the formula for the next row down in said respective column (COUNTIF('bbb'!$C$4:$C$16,"Online") and 'ccc' (COUNTIF('ccc'!$C$4:$C$16,"Online")and so forth forty some times thereafter.
Given that I am encountering this issue over multiple columns, I am easily going to have to manually alter some 300-400 cells at this rate should I not find a solution. I know there must be an easier way, I have tried creating a 'Custom Autofill List' but this does not translate to the formula bar and thusly will not fill the series. Additionally, I have tried to create a Macro but my lack of knowledge in VB and overall in this area of Excel has proved to be a difficult task..
View 3 Replies
View Related
Nov 6, 2009
I have an exported Excel worksheet1 from the parts database get every Friday. We get RFQ of parts list each week from multi customers about 3000+ parts as they send in MSword, MSoutlook or MSexcel to me I make into Excel worksheet2. I do not like to type in every part into the parts software I have my words for that software Cough Cough. The exported excel speadsheet tells the part numbers, Location, Qty, Price, ETC I would like to take the Excel RFQ list and have it populated from the other speadsheet
SAMPLE
A1 PART number that on both spreadsheet
A2 QTY on both there request and our stock
A3 Price
A4 Location
So want a compare worksheet1 with worksheet2
A1 = A* the populate A2-A4 with worksheet1 data
View 5 Replies
View Related
Jul 13, 2012
I'm trying to loop through a list of about 1300 items and copy the rows where one of the cells has a fill color to 2 different sheets in the same workbook. If there's no fill color, the row moves to a different sheet.
My code is determining that all cells have a fill.
For Each cell In Range("Classification")
If cell.Interior.Color blank Then
cell.Select
Range(Selection, Selection.Offset(0, -9)).Copy Destination:=Range("Compliance")
Range(Selection.Offset(0, -5), Selection.Offset(0, -9)).Copy Destination:=Range("Mstar")
Else
cell.Select
Range(Selection, Selection.Offset(0, -9)).Copy Destination:=Range("RP")
End If
Next cell
View 3 Replies
View Related
May 25, 2011
I have a spread sheet and I want to conditionally format rows to be a certain color. That part I'm fine with. But I don't want them to be a set color. I have a "key" of different colored cells that I want to be the fill colors of the formatting. The ultimate goal is that for example the key looked like this
red
blue
yellow
green
then the rows I had would be formatted as red, blue, yellow, and green. But if you were to go into the key and change the first cell from red to purple, then the rows would become formatted as purple, blue, yellow, and green. Obviously I can copy formating by hand using the format painter, but I want it to update automatically.
View 4 Replies
View Related
Dec 19, 2013
Source tab contains vital information about some clients.
In the aggregated tab (Cell C10) I created a formula that pulls the Inflows from the source in a very specific array. So for client 1, this works fine. Now, if i copy my formula to the client 2 (Cell C14), it obviously wont go and look in the correct array in my source.
What i need to do is to be able to copy/paste my formula
[Code].....
(from cells C10 to CC10) to cells C14 to CC14, but when copied, the look up array changes to:
Formula: [Code] ....
I will have to fill this formula to at least 100 entries down, so i need to make it work with ease
The good thing is that all look up values in the source increase by a fixed number of rows (12). I tried playing with index/rows formula.. no luck..
Attached File : samplev1.xlsx
View 1 Replies
View Related
Aug 16, 2012
I need to achieve the situation below with a formula. I have tried simply doing, for example, = B3+1 but this throws an error, probably because the value being checked is alphanumeric.
Data
A001
Data
A002
Add next number (A003) when data entered in cell to left
View 2 Replies
View Related
Nov 7, 2008
how to enter data in non-adjacent cells using a fill command.
Here is what I am trying to do:
in the column, I am holding ctrl button to select every 10th cell down the sheet. I need to enter a date in every selected cell that is exactly 7 days apart, i.e., 11/7/08 then 11/14/08 then 11/21/08, etc.... but no other dates or data.
I have tried to figure out a way to do this other than manually, but am confounded.
View 9 Replies
View Related
Dec 20, 2013
How do I write this formulae ??
For cell range M6:AV6 fill with N/R If the data in cell D1 = Wont have
View 5 Replies
View Related
Oct 2, 2008
I have a table:......
I want to colour in the relevant cells for each ref depending on the numbers in the stage column. So for the first line, the cells in columns 1,2,4&6 need to be shaded in. For the second line, the cells in columns 1,2,3,4,&5 need to be shaded in. I already have a lot of conditional formatting set on the sheet so need to do this with a macro.
I have tried to write something but am having issues with it finding the 1 and shading in the correct column but then jumping out of the loop and on to the next cell.
View 4 Replies
View Related
Sep 19, 2009
I am looking for advice on how to move cells containing data (columns D to K in EXAMPLE A), upwards so that the information lines up with data already existing in columns A to C (to be included as part of an overall VBA routine).
In the upper example data in cell D2 needs to move upto D1, E3 to E1, F4 to F1, G7 to G1 etc and K9 to K1. Now, data on following rows is to move upto row 2 eg: E5 to E2, F6 to F2, G8 to G2.
The first 'block' of data starts at row 1 and finishes in this case at row 9.
The next 'block' of data starts at row 10 and finishes at row 18.
Row 19 shown is the start of the next 'block'. These 'blocks' may have upto 20 rows ....
View 11 Replies
View Related
Apr 30, 2014
Is there anyway to automatically fill the empty added cell after inserting a row without using the fill handle? For example, for a series of numbers: [URL]
2. Drag the fill handle Selected cell with fill handle across the range that you want to fill.
Or running balance: [URL]
2. Extend the running balance formula into the new rows by selecting the last cell in the balance column and then double-clicking the fill handle.
View 6 Replies
View Related
Sep 6, 2007
I would like to auto populate a cell (A2) due to the input results from another (A1).
For example, if I enter A1 with "100%" then I want A2 to auto populate with "Complete". And just the same for other percentages; if A1 was input with any range from 1% to 99% it would populate A2 with "In Progress". And if A1 was to equal 0% then A2 would be "Not Started".
View 10 Replies
View Related
Mar 8, 2013
I have a worksheet with running macros which hides & unhide rows based on input of data in yellow highlighted cells (see attached). I'm trying to make all cells mandatory. The below code works but I run into problems when certain cells made mandatory are hidden. For example if I select "Expense" as Type of Expenditure in the attachment cell C10 & C11 are hidden so if its mandatory I won't be able to move forward to next cell.
Private Sub Worksheet_SelectionChange(ByVal Target As Range)
Application.EnableEvents = False
Me.Unprotect "dawnwh81"
Dim myCell As Range
Dim myRange As Range
[Code]....
View 2 Replies
View Related
Oct 10, 2008
i'm trying to ask my spreadsheet to fill a cell with either 'YES' or 'NO' depending on the value of one cell. I've succeeded in getting it to enter 'YES' but can't figure out how to tell it to choose between the two options. This is the formula so far
=IF(L5>2,"YES")
View 3 Replies
View Related
Dec 2, 2008
I have certain values in cell B4 to B2000. There are 25 unique values in those cells. In cells A4 to A2000 I would like to put a identifier (lets say a letter from A to Y) based on the adjacent B4 to B2000 cell values. I can't use a IF function because I am way over 7 allowed in excel. I could use a vlookup but that seems to slow down the file quite a bit. Is there something else better/faster out there?
View 3 Replies
View Related
Mar 15, 2007
I need to be able to fill in the day automatically when a date in entered
c1 (i type in) 15/3/07
then in a1 the day i listed by the formula =c1 and formatted to "ddd"
so i only type in the date and it fills in the day cell automatically down the rows are i enter new data
View 9 Replies
View Related
Jan 15, 2014
Fill the corresponding cell with last value entered?
View 9 Replies
View Related
Jul 20, 2014
I'm making a Purchase Order generator for work. Essentially, the main screen has buttons and the user selects the company, job number, their name etc. They click 'Generate' and it will great a brand new excel file for them with all the correct codes, ready to populate and send to a client. In the main sheet, we also have a master list showing every purchase order made to date. This is where I am currently stuck. I will have many more questions on the way. This is my first program so very new!
Lets say we have the following in cells A1 and A2. The rest is blank:
REQ0001
REQ0002
[Code] .......
View 3 Replies
View Related
Sep 17, 2008
I have a list of product codes. Some of the cells in this list are blank, and it is assumed that the blank row is the same product code as the one above it. Is there a formula I could use to have the cells fill themselves in?
Example
DO-566
DO-566
<Blank Cell>
DG-233
<Blank Cell>
<Blank Cell>
..........
I've tried the following, but it only yeilded each of the cells having the same values. =if(isblank(A2),A1,A2). With this, I allowed circular references, but it still yeilds that same result stated above.
View 4 Replies
View Related
Apr 5, 2013
I have lot of data in column B. I need to copy the first cell and paste content to next ones before empty cell.
Replacing xxx with the data in first cell all the way to the end of column B.
Before:
After :
123-1
123-1
xxx
123-1
[Code] ........
View 4 Replies
View Related
May 21, 2013
I have a spreadsheet with alot of information about a product. One column, is used to fill in a price that the item is going to be and in the column next to it, I show the date this change will happen.
What I need is another column (that has a price written on it already) to change and put in the price found in the "new price" column, if the date is equal to the column which show the date the price will change.
Example:
A
Item
B
Item's current Price
L
Item's increased price
M
Date increase will happen
I want "B" to change and reflect what "L" is reading when the date is the same as what is entered in "M".
Can that be done?
View 2 Replies
View Related
Dec 4, 2009
I am creating a form for others to fill in. But they don't fill it completely.
So i want to force them to
If they fill in Cell G31 or H31 they must also fill in cel F31, before it will save the document.
If they try to save the file without F31 filled, it should give a messagebox that
says: Fill in Volume.
Privatesub Workbook_BeforeSave(ByVal SaveAsUi As Boolean, Cancel As Boolean)
Dim msg As String
If Not Worksheets("Sheet1"). Range("G31").Value Like "##" then
msg = "Befor saving, fill in Volume."
Cancel = True
End If
If Not Worksheets("Sheet1").Range("H31").Value Like "##" Then
msg = msg & vbCrLf & "Before saving, fill in Volume."
Cancel = True
End If
If Cancel Then
MsgBox msg
End If
End Sub
View 9 Replies
View Related
Jul 17, 2006
on a form i have a combo box and on that combo box change event i want the following to happen. If the cboBox value = a company name then search database till you find that company name and then insert the companys details into a specific cell. So is that possible. im sure it is. I think it needs to be done by first checking the value of the box and then searching the database for that value. and lastly telling the cell it needs to be inserted into.
View 4 Replies
View Related