VBA transit the formula

Maci3j

Board Regular
Joined
Apr 4, 2013
Messages
85
Office Version
  1. 365
Hi everyone,

I would like to ask you for help.
I recorded a macro which does three things:
- column A: transits the formula,
- column A, J, K, N: colors the column names in red,
- column F, G, H, J, K, L, M, N, O: changes the format to date.


This is the macro:

Sub OTIF()
'
' OTIF Macro
'

'
Sheets("OTIF").Select
Range("A2").Select
Application.CutCopyMode = False
Selection.AutoFill Destination:=Range("A2:A1000")
Range("A2:A1000").Select
Columns("F:O").Select
Selection.NumberFormat = "m/d/yyyy"
Range("A1,J1:K1,N1").Select
Range("N1").Activate
With Selection.Interior
.Pattern = xlSolid
.PatternColorIndex = xlAutomatic
.Color = 255
.TintAndShade = 0
.PatternTintAndShade = 0
End With
Sheets("Instructie").Select
End Sub


The issue:
I would like to adapt it so the formula in column A6 will be transited to A7 if cell B7 is not empty.
Could you please help me with it?

Thank you in advance!
Capture.PNG
 

Excel Facts

Which Excel functions can ignore hidden rows?
The SUBTOTAL and AGGREGATE functions ignore hidden rows. AGGREGATE can also exclude error cells and more.

Forum statistics

Threads
1,214,651
Messages
6,120,739
Members
448,989
Latest member
mariah3

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