Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 6
Default 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   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 5,441
Default 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   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 772
Default 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
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Not sure what function, macro, etc to use Tony Excel Worksheet Functions 2 January 6th 08 06:10 PM
Is there a Function or Macro for This? Marilyn Excel Discussion (Misc queries) 6 November 6th 07 03:21 AM
Sub Macro vrs Function Macro Auto Start Pat Excel Discussion (Misc queries) 7 June 6th 07 09:53 PM
Function or macro? Rob N Excel Worksheet Functions 0 August 12th 06 08:14 PM
Macro or function MIchel Khennafi Excel Worksheet Functions 2 May 15th 06 09:16 PM


All times are GMT +1. The time now is 12:18 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"