Can You Define a Function for an Entire Column in Excel Using VBA?

  • Thread starter Thread starter cycling4life
  • Start date Start date
  • Tags Tags
    Function
Join the discussion
Ask a follow-up here, or get your own question answered by working scientists, mathematicians and engineers — people, not an autocomplete.
Real named experts · corrections over time · the nuance an AI answer skips
3 replies · 9K views
cycling4life
Messages
7
Reaction score
0
Is it possible to define a function for an entire column in excel? I have data importing from a chemical process simulator and every time it populates a row it will insert a blank row and I need to copy my formulas. Can I make it so, for example, column B is always equal to Column A+something, or etc?
 
Physics news on Phys.org
You can enter =sum(...) into a cell to add up a list of values in a column or row of cells, for example, =sum(a1..a10) produces the sum of the column of cells a1 through a10.
 
Last edited:
Create a template with the VBA function in the template...then use that template to make your sheet each time...that function will be available
 
Do you run a VBA routine to do the import, or manually import a text file, or is another program writing to the .xls file?

If you already have a VBA routine to do the import, you could just add a line to update the cell in column B for that row with your formula.