LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 102
Default Standard numbering

Hi,

I have a worksheet called '2. Template nummerlijst'. In this worksheet there
are various columns (A:K) starting on row 9 (row 8 contains headers). I have
1 macro to copy information from a different sheet onto columns B:I. Columns
J:K are blanks. The 2nd macro is used to copy a startdate form a single range
somewhere else in the same workbook and also to calculate an certain amount
to be credited per user. Because the information (size) of columns B:I is a
variable I use the next code to perform the 2nd macro;

Sub Startdate_Amount()

'Check if everything is filled in
If Creditbedrag_per_aansluiting = Range("'2. Template nummerlijst'!N16")
< 0 Then
MsgBox "Vul eerst creditbedrag per aansluiting in"
Else
'Copy down-date from rng

Dim rng As Range
Set rng = ActiveSheet.Range("J9")

'Get date
Windows("Fin-Cont tool.xls").Activate
Sheets("1. Checklist").Select
Range("B12").Select
Selection.Copy
Windows("Fin-Cont tool.xls").Activate
Sheets("2. Template nummerlijst").Select
Range("J9").Select
Selection.PasteSpecial Paste:=xlPasteValuesAndNumberFormats

'copy date down active content
rng.Copy Destination:=Range(rng, rng.Offset(0, -1).End(xlDown).Offset(0, 1))

'adjust lining to cel J8
Range("J8").Select
Selection.Borders(xlDiagonalDown).LineStyle = xlNone
Selection.Borders(xlDiagonalUp).LineStyle = xlNone
With Selection.Borders(xlEdgeLeft)
.LineStyle = xlContinuous
.Weight = xlMedium
.ColorIndex = xlAutomatic
End With
With Selection.Borders(xlEdgeTop)
.LineStyle = xlContinuous
.Weight = xlMedium
.ColorIndex = xlAutomatic
End With
With Selection.Borders(xlEdgeBottom)
.LineStyle = xlContinuous
.Weight = xlMedium
.ColorIndex = xlAutomatic
End With
With Selection.Borders(xlEdgeRight)
.LineStyle = xlContinuous
.Weight = xlMedium
.ColorIndex = xlAutomatic
End With
'adjust alignment
With Selection
.HorizontalAlignment = xlRight
.VerticalAlignment = xlBottom
.WrapText = False
.Orientation = 0
.AddIndent = False
.IndentLevel = 0
.ShrinkToFit = False
.ReadingOrder = xlContext
.MergeCells = False
End With

'Macro_om_te_crediteren_bedrag_per_aansluiting_te_ genereren
Dim rnga As Range
Set rnga = ActiveSheet.Range("K9")

'Get amount

Prorato = Range("'2. Template nummerlijst'!N15").Text
Creditbedrag_per_aansluiting = Range("'2. Template nummerlijst'!N16").Value
Looptijd_contract = Range("'1. Checklist'!B14").Value
Looptijd_Gemini = Range("'2. Template nummerlijst'!I9").Value

Te_crediteren = Range("'2. Template nummerlijst'!K9").Select
If Prorato < "Yes" Then
Range("'2. Template nummerlijst'!k9") = Range("'2. Template
nummerlijst'!N16").Value
Else
Range("'2. Template nummerlijst'!k9") = (Creditbedrag_per_aansluiting /
Looptijd_contract) * Looptijd_Gemini
End If

rnga.AutoFill Range(rnga, rnga.Offset(0, -1).End(xlDown).Offset(0, 1))
End If
End Sub

Now I want to use same sort of code to create a standard numbering starting
from cel A9 to whatever the length of the list (columns B:I) is. I tried it
with macro recorder, but because I need a variable I reckon this won't help
because in the recorder the absolute cel reference is displayed. Someone have
any suggestions?!

 
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
Standard deviation Svi Excel Discussion (Misc queries) 5 October 15th 07 10:13 AM
PO with sequential numbering with start / end numbering [email protected] Excel Discussion (Misc queries) 1 April 24th 07 03:38 PM
Changes to standard toolbar Alison Excel Discussion (Misc queries) 5 May 15th 06 11:44 PM
Standard Deviation Stan Banner Excel Worksheet Functions 1 March 11th 06 09:11 PM
Standard Modules in VBA Standard Modules in VBA Excel Programming 1 March 15th 05 03:33 AM


All times are GMT +1. The time now is 03:37 AM.

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

About Us

"It's about Microsoft Excel"