Excel Function

D

dhstein

I'm trying to write a User Defined Function and need the VB syntax to refer
to the cell. For example if my function is called func1 and I put the
formula =func1(B2) in my spreadsheet, I want to manipulate the contents of B2
in my function.

I need something like:

Function func1(Entry As Long)
Addr = Application.Caller.Address

func1 = Addr.Contents
End Function

I need some syntax help here and some basic VB instruction - I know enough
programming to be dangerous - I just need a little start. Is there a web
site I can refer to? Thanks for any help.
 
A

Argy - Arcasoft

Try This. Let me know your thoughts.

Function Cells_Control()
j = 4
i = 1
Sheets(2).Select
For i = 1 To 50
Cells(i, j).Value = "Movie " & i
Cells(i, j).Font.ColorIndex = i + 4 - j

Next i
End Function

This function will pring the title " Movie " Plus the movie number and it
will change the color for each line

Argy
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top