How to copy one column properties to newly created column - c#-4.0

After adding new column, we want to assign some particular column property to newly added column.
Measure Behavior: It's taking last column properties while adding new one.
How we can add new column with needed properties?
We are trying to add new column with below code in C#.
line = (Excel.Range)xlWorkSheet.Columns[ColumnNumber];
line.Insert();

Related

Excel Data validation list with array formula

I have a table with duplicated values in a column. How can I use this column, to provide unique values as a dropdown options in another cell? I want to be able to enter new rows in my table that might include already existing or new values and dropdown should automatically reflect this.
What I tried with UNIQUE(MyTable[MyColumn]):
Excel is not accepting this formula as a data validation source
I can spill UNIQUE(MyTable[MyColumn]) to range and name this range and use it as a data validation source, but the named range will not expand/contract automatically when my table data change
Excel will not accept UNIQUE(MyTable[MyColumn]) in a new table
You are on the right way - and yes: this is annoying and definitly not intuitiv.
You have to add a # after the reference to your range when naming it:
Then use the name for your validation list. It will now expand when you add a new row to the table.
D3: UNIQUE-Formula referencing the table-column
Name "lstValues": referencing $D$3#
then use lstValues
Alternative solution
Insert Power Query referencing original table as a source: = Excel.CurrentWorkbook(){[Name="MyTable"]}[Content]
RMB on a column to keep, Remove Other Columns (if any)
RMB on a column, Remove Duplicates
Close and Load to the sheet as a table, name table DropdownTable
Define new named range DropdownValues with reference to =DropdownTable (or =DropdownTable[#All] to include header)
Use =DropdownValues as a data validation source

Is it possible to not allow null values for particular in an excel data entry spreadsheet (VBA?)?

I have an excel worksheet where I have a number of manual data entry and calculated columns, which is to be filled in line by line with the rows filled from left to right.
I have a few columns which I want to ensure are not left blank as this data entry is carried out.
E.g.
Here I am entering data from left to right on the 3rd row and want to ensure that if the person doing the data entry manually accidentally skips the "Unique ID" column and tries to fill in "Type" first, they will be forced back to the "Unique ID" cell or at least experience a pop-up to tell them to enter in "Unique ID" first.
Is this something that can be done?
This can be handled in different ways; one of which is adding a simple data validation rule.
Add a data validation rule to the 2nd cell that checks whether or not the prior field is blank. If so, don't allow entry in the cell and display a pop-up message.
Data validation rules just have to have a a TRUE result.
Add this formula to a custom data validation rule on the 2nd cell.
not(isblank(c7))
Then, if the user tries to populate the 2nd cell while the 1st is still blank, the user gets an alert message and then the cell contents is cleared.
UPDATE #1
If you need to create a dependency for a data validation list you could add a table to a new sheet to act as your list handler. The basic theory is that one column is filled with an index of each row, a 2nd column checks to see if the criteria has been met, a 3rd column contains every item that could appear in the list and a 4th column is a formula that builds the list based on all of the criteria.
Here is a working example. It's a little different than your scenario but it shows the premise. The example below builds a list of items that can only be selected once. Once the item is selected in a cell, it does not appear in the lists for other cells.
t_FinalPlans_Medical is the name of the table.
medicalRow_FinalPlanSelections is a named range containing the cells that have the data validation rules/drop-down lists.
dataValid_FinalMedicalPlans_OptHeading is a named range holding the column header.
INDIRECT("t_FinalPlans_Medical[[#Headers],[Column1]]")
dataValid_FinalMedicalPlans_OptList is a named range for the index column.
INDIRECT("t_FinalPlans_Medical[Index]")
Index Column Formula IF([#[Unselected Plans]]="","",MAX($D$7:D7)+1)
Final Plan Selections Column
Each cell in this column is manually typed.
Unselected Plans Column Formula
IF(COUNTIF(medicalRow_FinalPlanSelections,[#[Final Plan Selections]])=0,[#[Final Plan Selections]],"")
Column1 Formula
IFERROR(INDEX([Unselected Plans],MATCH(ROW()-ROW(t_FinalPlans_Medical[[#Headers],[Column1]]),[Index],0)),"")
Formula used as Data Validation (dynamically expands) OFFSET(dataValid_FinalMedicalPlans_OptHeading,1,0,MAX(dataValid_FinalMedicalPlans_OptList),1)
https://trumpexcel.com/excel-drop-down-list/

Insert a new table in Excel when a new column is added to existing table

I have a spreadsheet with one BIG table in the top half, and corresponding "mini tables" in the bottom half. Each time I add a new column to the BIG table, I need a new "mini table" to be automatically added below. Can anyone help me with a VBA code that will do this? In my sample, let's say that column F was the last column in the BIG table. When I add column G, I need the "mini table" that begins in cell A 29 to be automatically created. Is this even possible?

Need to add empty Column in Spotfire Table Chart

I need to add few column headers in Table chart in Spotfire. Typically some calculated/transformation are added for the creation of new column. i just need to create the column with a name and keep it empty since the space will be used to fill data after the report has been printed. Any expression to make the column empty is also fine but want to know whether an empty column can be added
you can add a new calculated column with a formula of "" or NULL to make it empty

How to continue a series in a Excel table when adding new rows

I have a table in which a column contains weekdays, which are increased by one at each new row. Is there a way to make this automatic? I mean when I start typing new data to a new row, it automatically fills the weekday column following the series.

Resources