where or how do i create a function that ive been given?

  • Thread starter Thread starter lemel
  • Start date Start date
L

lemel

ive been given a function in text but i dont know where to enter it??
 
With only one workbook open,

do Alt+F11 and this should take you to the Visual Basic Editor (VBE). in
the menu there, choose Insert=>Module. Paste the code in that module.

Now do Alt+F11 to get back to excel.
 
Continuing this line of thought...
I am trying to get Excel to automatically page break at the end of
group of data specific to a person. The # of rows is not fixed
depending upon how much data we have for the person. The first colum
is dedicated to the name.
I am desperately trying to figure out VBA. I found this formula i
another help message in this forum:
Sub Insert_Page_Breaks()
'set to look for teachers names in column A
'will put a page break when the name changes
Set rng = Range(Cells(2, 1), _
Cells(Rows.Count, 1).End(xlUp))
For Each cell In rng
If Trim(cell.Value) <> _
Trim(cell.Offset(-1, 0).Value) Then
ActiveSheet.HPageBreaks.Add cell
End If
Next
End Sub

It is supposed to do the trick. Based on what I read in the 2nd pos
of this thread, I pasted it in. It doesn't print out with th
automatic page breaks.
Do I have to activate it in some way? Or does it just work on its own
I can't find much understandable help on VBA and would sure appreciat
a simple explanation of how it works. Thanks! Kimberl
 
In order to run that code Kimberly you'd have to go to your spreadshee
and go to tools/macros/maros, then look for your macr
"Insert_Page_Breaks" and press the run button
 

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

Similar Threads

Windows 10 Activate windows now message 3
Security on my PC 4
Access It's time for your check-in. 1
Windows XP photostory 3 slide show 3
webbrowser 2
Transferring of certain cells from one workbk to another 20
Opening the VB Editor via VB 5
Worksheet Object 1

Back
Top