Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.worksheet.functions
|
|||
|
|||
Using A Function in a Macro
Good Afternoon All,
I have a function built that takes a character based coded cell value and reformats into a number with a formula. The function works fine manually using it example =BigBookingNumber(cell value) However is it easy to create a macro that read sa specific column and runs the function where there is a value (And also replace the original value) So in a sense it take each value and puts =BigBookingNumber() around it Thanks in Advance Jai |
#2
Posted to microsoft.public.excel.worksheet.functions
|
|||
|
|||
Using A Function in a Macro
Jai,
To process every cell with a string in it: Dim Cell As RAnge For Each Cell In Range("NameORAddress").SpecialCells(xlCellTypeCons tants, 2) Cell.Value = BigBookingNumber(Cell.Value) Next Cell HTH, Bernie MS Excel MVP "Jai_Friday" wrote in message ... Good Afternoon All, I have a function built that takes a character based coded cell value and reformats into a number with a formula. The function works fine manually using it example =BigBookingNumber(cell value) However is it easy to create a macro that read sa specific column and runs the function where there is a value (And also replace the original value) So in a sense it take each value and puts =BigBookingNumber() around it Thanks in Advance Jai |
#3
Posted to microsoft.public.excel.worksheet.functions
|
|||
|
|||
Using A Function in a Macro
You just pass in the cell value, so if you were doing rows 1-10 for example
it would be: For i = 1 to 10 sheet1.cells(i,1)=BigBookingNumber(sheet1.cells(i, 1) Next not tested but this should be all you need. Depending on where you store the Function you may need to make it a Public function or move it to the current workbook. -- -John Please rate when your question is answered to help us and others know what is helpful. "Jai_Friday" wrote: Good Afternoon All, I have a function built that takes a character based coded cell value and reformats into a number with a formula. The function works fine manually using it example =BigBookingNumber(cell value) However is it easy to create a macro that read sa specific column and runs the function where there is a value (And also replace the original value) So in a sense it take each value and puts =BigBookingNumber() around it Thanks in Advance Jai |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Not sure what function, macro, etc to use | Excel Worksheet Functions | |||
Is there a Function or Macro for This? | Excel Discussion (Misc queries) | |||
Sub Macro vrs Function Macro Auto Start | Excel Discussion (Misc queries) | |||
Function or macro? | Excel Worksheet Functions | |||
Macro or function | Excel Worksheet Functions |