M
mike
Hello, thank you for helping in advance..
i have a couple of macros that was i was working on and
was helped ( alot).. i am currently reading a excel step
by step book by reed jacobson and i am learning the term
adn properties as i go along here. Will anyone be willing
to decipher and explain each statement in "idiot" terms
so i can see how it actually worked and understand it? i
find it fascinating to do macros. I would be thrilled if
anyone can break these down.
again thanks you for helping. mike
Sub copy_to_sheet()
copy_to = "Month" & Range("month_val").Value
last_used = Sheets(copy_to).Cells.SpecialCells _
(xlCellTypeLastCell).Address
copy_to_address = Rows(Sheets(copy_to).Range _
(last_used).Row + 2).Columns(1).Address
If copy_to_address = "$A$3" Then copy_to_address = "$A$1"
Sheets("form").Range("form_data").Copy Destination:=Sheets
(copy_to).Range(copy_to_address)
End Sub
and...
Private Sub Worksheet_Change(ByVal Target As Range)
this_month = 1
dd = Range("start_date").Value
Do While dd < Range("ref_date").Value
dd = 1 + dd
If Day(dd) = 25 Then this_month = 1 + this_month
Loop
Range("month_val").Value = this_month
End Sub
**what did the argument in paratheses mean? "(ByVal
Target As Range)" and "this_month = 1 ..What is
this "statement" telling Excel?
thanks!!!
i have a couple of macros that was i was working on and
was helped ( alot).. i am currently reading a excel step
by step book by reed jacobson and i am learning the term
adn properties as i go along here. Will anyone be willing
to decipher and explain each statement in "idiot" terms
so i can see how it actually worked and understand it? i
find it fascinating to do macros. I would be thrilled if
anyone can break these down.
again thanks you for helping. mike
Sub copy_to_sheet()
copy_to = "Month" & Range("month_val").Value
last_used = Sheets(copy_to).Cells.SpecialCells _
(xlCellTypeLastCell).Address
copy_to_address = Rows(Sheets(copy_to).Range _
(last_used).Row + 2).Columns(1).Address
If copy_to_address = "$A$3" Then copy_to_address = "$A$1"
Sheets("form").Range("form_data").Copy Destination:=Sheets
(copy_to).Range(copy_to_address)
End Sub
and...
Private Sub Worksheet_Change(ByVal Target As Range)
this_month = 1
dd = Range("start_date").Value
Do While dd < Range("ref_date").Value
dd = 1 + dd
If Day(dd) = 25 Then this_month = 1 + this_month
Loop
Range("month_val").Value = this_month
End Sub
**what did the argument in paratheses mean? "(ByVal
Target As Range)" and "this_month = 1 ..What is
this "statement" telling Excel?
thanks!!!