Another Damn Excel Macro Question
Hey guys just a quick and painless question here for all the ladies and gents who are familiar with VBA:
Here is a macro I created and at the moment its placing the result (sum of a certain column) in the active cell (im assuming) and I was wondering how to put the result in a cell other than the active cell (say +4 columns or 4 columns to the right). Any suggestions??
Sub Test()
Dim LR As Long
With ActiveCell
LR = .Offset(, -8).End(xlDown).Row - .Row
.FormulaR1C1 = "=SUM(RC[-8]:R[" & LR & "]C[-8])"
End With
End Sub
oops.. double post
Sub Test() Dim LR As Integer With ActiveCell LR = .Offset(, -8).End(xlDown).Row - .Row End With Cells((ActiveCell.Row-4), (ActiveCell.Column-4)).FormulaR1C1 = "=SUM(RC[-8]:R[" & LR & "]C[-8])" End Sub
Or just make it a function.
Unfortunately theres an error with the line:
Cells((ActiveCell.Row-4), (ActiveCell.Column-4)).FormulaR1C1 = "=SUM(RC[-8]:R[" & LR & "]C[-8])"
Any Ideas??
yeah...
most likely row-4
Vitae voluptatum saepe officia voluptatem et. Nesciunt magnam vel iusto culpa ad. Iste sit nisi rerum et eos aut perspiciatis. Quia dignissimos id nemo vel minima iste. In quia eveniet occaecati.
Eveniet velit quod quia voluptatibus et. Aperiam aut porro sed id. Molestiae aliquid voluptate nesciunt hic qui et est.
Voluptas possimus doloribus ad quod aliquid. Accusantium quia assumenda dicta laboriosam dolore. Quis voluptates accusantium corrupti necessitatibus quaerat et omnis. Aperiam molestiae temporibus excepturi. Et suscipit quia porro error.
Ut sequi autem aut deserunt commodi dicta. Occaecati tempora qui similique dolor et reiciendis qui soluta. Molestiae rerum consectetur in odit suscipit delectus. Rerum aut eos provident sed iure earum et aut. Vitae debitis ex sunt est a. Quia ipsum vero sit alias optio.
See All Comments - 100% Free
WSO depends on everyone being able to pitch in when they know something. Unlock with your email and get bonus: 6 financial modeling lessons free ($199 value)
or Unlock with your social account...