Re: Converting to VBA code
what you would like to do?
please give more details.
If ... What?
Re: Converting to VBA code
dude...better go through an example...
Re: Converting to VBA code
Or just record a macro doing your task. Then stop and view the generated module code.
Re: Converting to VBA code
Re: Converting to VBA code
Yup, recording macros is the #1 way to initially find out how a task is done in most Office apps,where recording macros are supported.
:)
Re: Converting to VBA code
Ok, here is the code I am working on:
VB Code:
Sub ChangeFormulas()
'
' Macro1 Macro
Dim rngCLM As Range
Dim mthval As Object
'mthval is the fiscal month
Set mthval = ThisWorkbook.Worksheets("External Sales").Range("B2")
'Start with the first column
Set rngCLM = ThisWorkbook.Worksheets("External Sales").Range("G9")
Do
'rngCLM is a number above each of the 12 columns in white font, it it only used as a counter for the macro
If rngCLM >= mthval Then
'copy rows 5 through 50 of the preceeding column
'Paste special values ("hardcode") that data anywhere(just somewhere off to the side)
'Now copy that hardcoded data you just pasted
'Now past special values "Subtract" on the original offset (1,0)RngCLM
Else
'Do Nothing
End If
Set rngCLM = rngCLM.Offset(0, 1)
Loop Until rngCLM.Value = ""
End Sub