Dynamically Fill Range Of Columns Based On Value Of Cell In Another Sheet

Feb 24, 2014

I wanted to enter value in sheet1 on A1. Columns in sheet2 from B1 until the value entered in sheet1.A1 should be automatically filled.


Sheet1.A1=5, then Sheet2.B1=1, Sheet2.B2=2, Sheet2.B3=3, Sheet2.B4=4, Sheet2.B5=5.

if Sheet1.A1=3, then Sheet2.B1=1, Sheet2.B2=2, Sheet2.B3=3.

if Sheet1.A1=7, then Sheet2.B1=1, Sheet2.B2=2, Sheet2.B3=3, Sheet2.B4=4, Sheet2.B5=5, Sheet2.B5=6, Sheet2.B5=7


View 2 Replies


Dynamically Set Combobox List Fill Range

Jan 1, 2010

I have a combobox whose list is filled with different ranges, on different sheets, selectable using option buttons. The code is shown below:

Private Sub OptionButton1_Click()
Dim ray
Dim Last
ray = Sheets("Trades").Range("B2:B500")
If OptionButton1 = True Then
With ComboBox1
.List = ray
.ListIndex = 0
End With
End If
End Sub

View 9 Replies View Related

Delete Columns And Rows Based On Cell Fill Color

Jan 31, 2014

I am a locksmith and attempting to write a spreadsheet app. for my line of work. The output page will use columns A-G and rows 1-?10000? depending on the size of the system. If a 5 pin system is requested then columns A+B will be blacked out. 6 pin system A is blacked out. 7 pin system nothing blacked out. Also, if any cell matches the master key that was input, that cell is filled with red. I know, confusing.

Basically, I am trying to remove the blacked out columns automatically, and to remove the enitire row is any cell in that row is filled with red. Then to remove blank lines.

View 2 Replies View Related

Referencing A Named Range Or Sheet Dynamically?

Apr 19, 2013

I have a challenge I'm trying to surmount. I have an excel sheet in which I want to be able to select Zone codes from a drop down, click on a link "search" which takes me to a place in the document that has been named according to the Zone code i pick in the drop-down. I want to achieve this using only formulas as i'm distributing the file to a wide audience who are not versed enough with computers to know how to enable macros.

View 3 Replies View Related

Fill Date Across Columns Based On User Date Range Input?

Mar 5, 2014

based on user date ranges entered on sheet1, I'm trying to write code that will write each month of the date range on other sheets across the 2nd row. at this point I'm getting "object required" error at "Set DateStart = Cells(2, 6)"

I also want the date format to be mmm-yy (Mar 14) on the sheets even if sheet1 has a different format. I tried using sourcerange instead of DateStart, but that didnt work either.


Dim projStartDate As Date
Dim projEndDate As Date
Dim DateStart As Date[code]....

View 1 Replies View Related

Auto Fill A Cell With A Value Based On Pre-defined Range

Mar 19, 2013

A have three columns with "Kilograms range" and corresponding value.

A========== B========== C
KG From====-To======= Predefined Value

what formula will fill up the cell with the predefined value automatically based on the range, after a kilograms are entered in a different cell as explained in the attachment.

View 2 Replies View Related

How Do I Fill In A Cell Based On The Relationship Of The Number Within A Range Of Numbers

Feb 6, 2009

This is a spreadsheet for a real estate office. The boss gave me a spreadsheet that he created to give a seller an idea how much money he will walk away with at closing. The spreadsheet includes all of the pertinate numbers but there is one item that he would like to have filled in automatically. When selling a house, you use a title service that charges a fee based on the price of the house. So, for example, If the house sells for $0 to $50,000, then let's say the fee is $112. If the house sells for $50,000 to $60,000, then the fee is $118. If the house sells for $60,000 to $70,000, then the fee is $125, and so on up to 1.5 million.

The boss' spreadsheet includes 5 different selling price scenarios, which I guess doesn't matter since you do the first one and the rest follow the same pattern.

So how do I automatically fill in a cell based on how one number falls within a range of other numbers? The fee schedule will be within the same spreadsheet, if that matters.

Ideally, I think they should be separate files, but this will be used in various locations as different realtors take it home or use it on their laptops.

View 9 Replies View Related

Fill Range With Data Meeting Conditions Based On Cell Value

Apr 23, 2009

refer to attached worksheet.

I need a way (Non-Macro please) - where if a condition is met, then fill a range with a particular value. The attached spreadsheet has a sample with explanation.

View 9 Replies View Related

How To Define A Cell To Be A Range Dynamically

Feb 14, 2013

The way I have try to define lastcell is wrong. But I don't know how to do it.

Sub createUniqueRecordID_2()
' fill using CTRL + ENTER
Dim lastcell
Sheets("projects list").Select


View 1 Replies View Related

Dynamically Adding Row Blocks Based On Cell Value

Apr 2, 2014

I've managed to get coding that allows me to insert single rows dynamically based on a cell value. Example is if I enter a value in cell C3 the coding inserts the same number of rows below.

I've also created a simple macro that inserts a multiple row block under the active cell, complete with formatting, text and some merged cells. Example is I run the macro and it will insert a block of 3 rows, complete with formatting, borders, text and merged cells.

My challenge is to bring these two elements together. So enter a number in a single cell which will then insert the same number of row blocks, complete with formatting etc. I've added a file to sample what it is I'm trying to achieve. I can add the coding I already have as well.

Dynamic list sample.xlsx‎

View 2 Replies View Related

Dynamically Alter Macro Based On Tab Name Or Cell Value

Feb 1, 2014

I have a workbook with several tabs. One tab is named for the year eg 2014. Annually, I open the workbook, rename to the new year and rename the year tab to the next year eg 2014 to 2015. All the dynamic range names update as expected. Sheet2(2014) becomes Sheet2(2015). However, a line of macro code does not change and errors out because the year does not change.

Is there a way to dynamically modify the '2014' sheet reference to reflect the renaming of the year tab eg to 2015 or to reference a helper cell named YEAR?

The cell referenced above R332C1 is dynamic.

I have tried writing the above line many ways based on internet research but no success. I suspect I can use a LEN function to actually modify the line of code but I'm not sure its even possible to alter a macro dynamically to meet my needs here.

View 6 Replies View Related

Assign Names Dynamically Based On Cell Content

Jul 10, 2009

I do have a data set from A1:C8 as follows:-
Brand Name(A1)Sales Value(B1)Margin(C1)Levi's100002000Arrow150002500Allen Solly120001300Hanes80001000John Miller250004500Disney280003200Ray Ban180002100

The above brands are categorized as follows:-
Brand NameProposed CategoryLevi'sConsignmentArrowBrandAllen SollyBrandHanesBrandJohn MillerPrivate LabelDisneyBrandRay BanConcessionaire

I would like to put formula from D1:D8 in such a way so that the Proposed categories are extracted automatically through formulae. This will help in getting the contribution calculated from different categories.
Brand Name(A1)Sales Value(B1)Margin(C1)Category(Desired Result)(D1)Levi's100002000ConsignmentArrow150002500BrandAllen Solly120001300BrandHanes80001000BrandJohn Miller250004500Private LabelDisney280003200BrandRay Ban180002100Concessionaire

View 9 Replies View Related

Dynamically Create Named Ranges Based On Cell

Dec 16, 2007

I am looking for a solution to dynamically create named ranges according to the contents of cells in a particular column. The following code works for 1 word names, but in many cases the title cell contains numerous words separated by spaces. Is there a way I can adapt this code so that it will name the ranges with the spaces removed? For example, where cell C2 contains the narrative 'Sales Ledger Control', I would want the range name 'SalesLedgerControl'.

Range("R2:Z2").Name = Range("C2")

The named ranges are referred to in numerous other worksheets, where selecting a particular narrative from a listbox creates a dependant drop-down in the adjacent cell (eg if Sales Ledger Control is selected, the dependant list contains names of customers). FYI, the data validation in the other worksheets ignores the spaces in the range names, ie: =INDIRECT(SUBSTITUTE(G2," ",""))

It would not take me long to name the ranges manually, but a macro is preferable because the narratives in the title cells will often change and the range names will obvioulsy also therefore change.

View 4 Replies View Related

Copying Columns For N Times Based On Value In A Cell On Same Sheet

Oct 8, 2013

With reference to attached file. I want to copy column D&E for 'n' number of times of value based on B1. If value in cell B2 is 0 then hide cell D&E and if there is any other value, excel to copy E&F to next column (leaving one column blank after each paste).



Product A




View 5 Replies View Related

Hide Columns In Sheet Based On Value In Double Clicked Cell

Jun 4, 2014

I have a workbook with two sheets, Project Overview and Projects Detailed. In Project Overview column K is different project numbers and what i need the code to do is when this number is pressed it has to go to Projects Detailed and search for this number in column AV and hide the lines that does not correspond with the number that has been double clicked.

In project overview you should only be able to press the numbers from row 9 and down and in Projects Detailed the numbers in column AV also starts in row 9. Some of the cells in column AV are empty and these should also be hidden.

View 2 Replies View Related

Summarize Columns, Based On Unique Value, Into 1 Sheet With Cell Addresses

May 25, 2008

I have the following code always throwing this error message: "subscript out of range". When i run the macro with worksheets that only have 10 rows each, it's running fine. I suspect some issues on the line: a = Range("a1"). CurrentRegion.Resize(, 3) - the debug always throws the error before entering the loop. This macro is supposed to find the lowest price among 3 spreadsheets by matching the "Code" column and sending the final result into a new spreadsheet. But since im trying to run the macro on spreadsheets holding over 6000 lines each, this error is appearing.

Sub kTest_v2()
Dim a, w(), i As Long, z, dic As Object
Dim MySheets, ws As Worksheet, MinPrice
MySheets = Array("Sheet1", "Sheet2", "Sheet3") 'change to suit
Set dic = CreateObject("scripting.dictionary")
dic.comparemode = vbTextCompare
For Each ws In Sheets(MySheets)
With ws
'assume Col A Country, Col B Code and Col C Price
a = Range("a1").CurrentRegion.Resize(, 3)
End With
For i = 2 To UBound(a, 1) 'assume column heading. if not replace 2 with 1
If Not IsEmpty(a(i, 1)) Then
If Not dic.exists(a(i, 2)) Then
Redim w(1 To 4): w(1) = a(i, 1) 'Country
w(2) = a(i, 2) 'Code
w(3) = a(i, 3) 'Price
w(4) = Cells(i, 1).Address(external:=True) 'cell address
dic.Add a(i, 2), w

View 7 Replies View Related

ListBox Fill 3 Columns With Worksheet Range's

May 10, 2009

Hi if possible can someone please tell me how u populate a list box with three columns i want 1st col "A12:A209" 2nd col "B12:B209" 3rd Col "D12:D209" shown in it. Ive tried everything i can think of and cant get it to work

View 8 Replies View Related

Macro To Fill Cells Of Rows Based On Two Other Columns

May 28, 2014

Data file with few columns. There are groups of similar ID numbers in Column J. For a group of similar ID numbers in consecutive rows there is only one row that has a number greater than 0 in its Column L cell and the rest of the cells of Column L for that set of similar IDs is filled with 0s.

First for that unique ID group I need to find out which row is it that has a value greater than zero in its Column L cell.

Then I need to use that value to fill the rest of the 0s in Column L corresponding to that set of Unique IDs.

The process continues with identifying similar IDs in Column J and this time doing the same thing for their Column M. I have attached a sample file that shows the data and how the results need to look like.

See here Fill Cells.xlsx

View 1 Replies View Related

Fill Array From Range Selecting All Rows And Some Columns

Jul 21, 2014

I want to fill an array from values in range A1:H10. I want to fill the array with all rows in range and only columns B,C and E. I have the code below so far using index function.

Is there a more direct way to select all rows from desired range to avoid the need to create an array of rows from 1 to LastRow and then use Application.Transpose(RowsArr) (in red) inside Index()?

View 3 Replies View Related

Delete Sheet Based On Cell Range

Dec 11, 2008

Let's say that I've got 125 sheets. The 1st "Reference", and the rest sheets names are "1" to "124". I need a macro to delete sheet based on cell range A1:A300. If the range contain 25 data so the number of sheet will be 26 (Reference and 1-25)

View 9 Replies View Related

Change Columns Fill Or Border Color Based On Current Date

Aug 21, 2014

I have a simple spreadsheet. A column for a persons name and 31 columns, one for each day of the month. I want to apply conditional formatting, either fill color or border color, to the date column of the current date when the spreadsheet is opened.

View 2 Replies View Related

Sum A Cell Dynamically Based On Another Cell

Aug 2, 2006

I have a spreadsheet which I use a number in cell E4 which can be an integer for instance let's say E4=9.

I want to go down a column and get the sum dynamically for let's say when the cell in E4=3.

The range in column G starts at G27. I then want to return the dynamic value to cell E3.

What is the best way to accomplish this using vba code?

View 9 Replies View Related

Copy Rows To Sheet Based On Cell Value In Range

Aug 16, 2007

a macro button on my excel sheet that should do the following.

i have a range (Ex: E3:E46) which is being continuously filled, i need to transfer the information to another sheet depending on column "E", (Ex: if "E3" = "A" paste row to sheet2 if = "B" paste row to sheet3) and so on each row could have another string in column "E".

after the paste is done it should clear the range making place for new entries, that should also be copied finding the next empty cell (it shouldn't delete the old entries)

View 9 Replies View Related

Fill Range Based On Button Position

Jul 3, 2007

I'm trying to find out how can I fill a range of cells when clicking in a Command button in Excel. The process should be:

1) The user opens my XLS worksheet.
2) Goes to the next empty row and fill some specific fields
3) Then he should fill up 15 parameters on the right as Y or N
4) In case all of them are correct instead of going one by one typing "Y" I want he clicks in a button (with VBA code associated) and then 15 cells on the right should be filled with "Y" value

View 8 Replies View Related

Fill Range Based On Value & Export To New Workbook

Jan 5, 2008

(The attached workbook will provide a more obvious explanation.)

I am building a 'reporting' workbook. It has 3 tabs.

i. the first I will use for buttons to call macros (no help needed)
ii. the second tab is 'REPORT' - where data from the third tab ('DATA') will be collected/organized -based on a textual value in column D - before being exported into a seperate workbook (finalized report).
iii. third tab is 'DATA' - this sheet will contain all the data that will provide info for reports

Presently, the 'REPORT' tab has been manually filled in with data from 'DATA' tab - I did this thinking it would provide better explanation here; take note that values in column D will be gathered via vlookup to other worksheets not included her.

Here is what I want to do:

1. goto 'DATA' tab, find the first PLATFORM (column D) text value

2. goto 'REPORT' tab, put that text value in B2

3. go back to 'DATA' and in each row that the same PLATFORM is present, copy over the corresponding info to the appropriate cell in 'REPORT' tab

4. once I've collected all the rows for one PLATFORM - export and save the 'REPORT' worksheet to a seperate workbook in 'C:REPORTS' and close

5. clear the range where data is being written in 'REPORT' tab ("A5:H60000"), then go back to 'DATA' and get the next PLATFORM (column D) text value - enter it into B2.

6. fill the range ("A5:H60000") with the corresponding values from 'DATA' based on the new PLATFORM name...

View 3 Replies View Related

Fill Range With Sequential Numbers Based On Corresponding Column Groups

Feb 15, 2010

In the attached workbook I'm trying to populate Column E with sequential numbers (as shown) based upon a changing range (defined as a named range called 'range'). Is it possible to write a formula in the cells in Column E that will do this?

View 2 Replies View Related

Fill Multi Columned ListBox Based On Range Meeting 2 Conditions

Mar 14, 2008

I'm trying to populate a dropdown Combo Box by using conditions.

In the example I attached...I would be trying to use ComboBox1.ListFillRange to populate the ComboBox only with players who have "C" in the Position column and "ANA" in the Team Code Column. Which would give me all the Catchers on the Angels.

I've been trying to use worksheetfuntion.Index.

View 4 Replies View Related

Dynamically Hide Columns

May 15, 2007

I am using drop-down lists in a cell to filter out some data in a spreadsheet. Works great, but I would like to hide certain columns depending on which item is selected in the drop-down list. I have written a macro to do this, but I cannot get the macro to run automatically every time there is a change in the drop-down list.

View 9 Replies View Related

Fill Cell W/ Value Present In Another Row, If Columns Match

Jun 30, 2009

I have a slight conundrum that goes as follows:

If in a given row, the cell in column A is empty, but the cells in columns B and C have values--would it be possible to automatically fill in the empty cell with the same value of another rows column A cell, if both rows share the same value (nb: not case sensitive) in the column B and C cells.

For example:

If one row, say Row 44, contained the following:

Column A Cell =
Column B Cell = sunday
Column C Cell = dog

and another row, say Row 10023, contained:

Column A Cell = Walk
Column B Cell = Sunday
Column C Cell = Dog

How would I go about automatically filling in Row 44's column A cell with the value "Walk", as both rows columns B and C cells match up.

I should mention that I am dealing with a sheet with over 30'000 rows, so it would be incredibly time consuming to find matches and input the missing value directly.

View 13 Replies View Related

Get The Range Address Of A Dynamically Named Range That Refers To A Formula In VBA

Aug 10, 2008

I have a named range that expands and contracts based upon the amount of data that is in some column. Call it AllData_UsedRange.

I have another named range that actually refers to a range. Call it AllData.

Column A
Row2 56
Row3 44
Row4 65

AllData is a named range that refers to the range A2:A65536
AllData_UsedRange refers to A2:A4 by way of this formula.

How to I obtain an address of AllData_UsedRange in VBA code?

These do not work...

View 9 Replies View Related

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