annadinesh
Board Regular
- Joined
- Mar 1, 2017
- Messages
- 105
Yess BOSS u r right C23 and C24 are Merged , Copy Problem Solved, But Please help me with the Format of C23 and C24 value
YES, HOWWould it be possible to see your Excel file so that I can give you a more accurate solution?
Option Explicit
Sub Sample()
Dim ws As Worksheet
Dim rng As Range
'~~> Change to relevant sheet
Set ws = Sheet1
With ws
If Date - CDate(.Range("G6").Value2) > 730 Then
Set rng = .Range("C23")
Else
Set rng = .Range("C24")
End If
rng.Copy .Range("C4")
End With
End Sub
Option Explicit
Sub Sample()
Dim ws As Worksheet
'~~> Change to relevant sheet
Set ws = Sheet1
With ws
If Date - CDate(.Range("G6").Value2) > 730 Then
.Range("C23").Copy .Range("C4")
Else
.Range("C24").Copy .Range("C4")
End If
End With
End Sub
its copying but all in black colour, Same format not copyingWhat happens if you try this?
VBA Code:Option Explicit Sub Sample() Dim ws As Worksheet Dim rng As Range '~~> Change to relevant sheet Set ws = Sheet1 With ws If Date - CDate(.Range("G6").Value2) > 730 Then Set rng = .Range("C23") Else Set rng = .Range("C24") End If rng.Copy .Range("C4") End With End Sub
or simply
VBA Code:Option Explicit Sub Sample() Dim ws As Worksheet '~~> Change to relevant sheet Set ws = Sheet1 With ws If Date - CDate(.Range("G6").Value2) > 730 Then .Range("C23").Copy .Range("C4") Else .Range("C24").Copy .Range("C4") End If End With End Sub
Ok do this. Upload the file in say dropbox or any other free file sharing site and share the link here. We will take it form there
1ST FS | 2ND FS | 3RD FS | LAST PMS |
04.03.2019 | 23.06.2020 | 03.01.2021 | |
26.02.2005 | 29.07.2005 | 15.10.2005 | |
30.07.2018 | 06.05.2019 | 04.01.2021 |