Formula check

deanl33069

Board Regular
Joined
May 2, 2019
Messages
120
I have this formula

Sub w3202L()
'
' w3202L Macro
'


'
Sheets("Misc").Select
Range("AA6").Select
ActiveCell.FormulaR1C1 = "=(R[1]C[-13])"
Range("AA6").Select
Selection.Copy
Range("AA6:AA370").Select
Selection.PasteSpecial Paste:=xlPasteFormulas, Operation:=xlNone, _
SkipBlanks:=False, Transpose:=False
Range("AA11").Select
End Sub

I need AA6 to be N6 and it comes out N7
 

Excel Facts

Which came first: VisiCalc or Lotus 1-2-3?
Dan Bricklin and Bob Frankston debuted VisiCalc in 1979 as a Visible Calculator. Lotus 1-2-3 debuted in the early 1980's, from Mitch Kapor.
Try changing:
Code:
[COLOR=#333333]"=(R[1]C[-13])"[/COLOR]
which offsets the row count by 1 to:
Code:
[COLOR=#333333]"=(RC[-13])"[/COLOR]


Note you can also speed up your code and shorten by getting rid of most your Select statements. They are not neceesary.
This:
Code:
[COLOR=#333333]Range("AA6").Select[/COLOR]
[COLOR=#333333]ActiveCell.FormulaR1C1 = "=(RC[-13])"[/COLOR]
can be simplified to this:
Code:
[COLOR=#333333]Range("AA6").[/COLOR][COLOR=#333333]FormulaR1C1 = "=(RC[-13])"[/COLOR]


And this:
Code:
[COLOR=#333333]Range("AA6").Select[/COLOR]
[COLOR=#333333]Selection.Copy[/COLOR]
can be simplified to:
Code:
[COLOR=#333333]Range("AA6").[/COLOR][COLOR=#333333]Copy[/COLOR]
etc, etc
 
Last edited:
Upvote 0
How about
Code:
Sub w3202L()
Sheets("Misc").Select
Range("AA6:AA370").FormulaR1C1 = "=(RC[-13])"
Range("AA11").Select
End Sub

I'm definitely getting slow today
 
Last edited:
Upvote 0
TY Everyone this is working well......I did 4 different formulas from the statement.
How can i create pull down menu to select different ones?
 
Upvote 0
How can i create pull down menu to select different ones?
I do not know what you mean. Please explain in more detail.
 
Upvote 0
so i have used 4 different scripts i would like to make a drop down menu to select which script to use....tyvm
1)Sub w3202L()xxxxxxxx
2)Sub w3201L()xxxxxxxx
3)Sub w3102L()xxxxxxxx
4)Sub w3101L()xxxxxxxx
I
 
Upvote 0
Is your dropdown a Data Validation dropdown?
If so what cell is it in?
 
Upvote 0
I'm afraid I don't understand, where is your dropdown menu & what type of drop down is it?
 
Upvote 0

Forum statistics

Threads
1,223,911
Messages
6,175,337
Members
452,637
Latest member
Ezio2866

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top