COPYING A CELL VALUE TO ANOTHER CELL WITH SAME FORMAT WITH FORMULA

annadinesh

Board Regular
Joined
Mar 1, 2017
Messages
105
Hi Team

I want to copy cell value of C23 & C24 to A2 based on Date via formula =IF(TODAY()-G6>730,C23,C24)

but the value comes on G6 should as same as in C23 & C24 format.


Please help


Dinesh Saha
9932022569
 

Attachments

  • excel value.jpg
    excel value.jpg
    111.7 KB · Views: 7
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

Would it be possible to see your Excel file so that I can give you a more accurate solution?
 
Upvote 0

Excel Facts

Create a chart in one keystroke
Select the data and press Alt+F1 to insert a default chart. You can change the default chart to any chart type
Take a screenshot of Range A1:E30 and post the image here. Ensure the column and row headers are also captured so it is easier to identify the range.
 
Upvote 0
I want cell value of C23 & C24 to C4 based on Date via formula =IF(TODAY()-G6>730,C23,C24)

but the value comes on C4 should as same as in C23 & C24 format.


Please help


Dinesh Saha
9932022569
 

Attachments

  • ExCEL SAMPLE FILE.jpg
    ExCEL SAMPLE FILE.jpg
    253.7 KB · Views: 4
Upvote 0
What 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
 
Upvote 0
What 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
its copying but all in black colour, Same format not copying
 
Upvote 0
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
 
Upvote 0
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

Ok that will we manage with the Black Text, Please help me for the following

1ST FS2ND FS3RD FSLAST PMS
04.03.201923.06.202003.01.2021
26.02.200529.07.200515.10.2005
30.07.201806.05.201904.01.2021

I have 4 colomns E to H in which i want in cell of coloumn H the value should shows the value like this

if value of a cell in coloumn E is in red colour then the value of cell H will be value of cell E, if the value of E & F is Red then the Value of cell of coloumn H should be the value of F, if the value of E F & G are red then the value of H should be value of G

Hope you understood my question


Regards


Dinesh Saha
9932022569
 

Attachments

  • copy coloured text.jpg
    copy coloured text.jpg
    24.8 KB · Views: 4
Upvote 0
I suggest that you post this as a new question else this thread will never end :)
 
Upvote 0

Forum statistics

Threads
1,214,925
Messages
6,122,298
Members
449,077
Latest member
Rkmenon

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