Microsoft Office Forums

Go Back   Microsoft Office Forums > >

 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
  #2  
Old 09-19-2019, 08:41 AM
NoSparks NoSparks is offline Need Help Creating a Macro Windows 7 64bit Need Help Creating a Macro Office 2010 64bit
Excel Hobbyist
 
Join Date: Nov 2013
Location: British Columbia, Canada
Posts: 842
NoSparks is a glorious beacon of lightNoSparks is a glorious beacon of lightNoSparks is a glorious beacon of lightNoSparks is a glorious beacon of lightNoSparks is a glorious beacon of light
Default

Give this a shot, if the coloring of the date cells was just for emphasis and not needed,
remove the variable from the declarations and the two color lines in the macro.
Code:
Sub rsrasc()
    Dim i As Long, ws As Worksheet
    Dim rng As Range, cel As Range
    Dim lr As Long, dte As Date, colour As String
    
Application.ScreenUpdating = False
Application.Calculation = xlCalculationManual

For i = 1 To Sheets.Count
    With Sheets(i)
        dte = .Range("A4").Value
        colour = .Range("A4").Interior.Color
        lr = .Range("B" & .Rows.Count).End(xlUp).Row
        For Each cel In .Range("C6:C" & lr)
            If cel.Offset(, -1) <> "" Then
                With cel
                    .NumberFormat = "d-mmm-yy"
                    .Interior.Color = colour
                    .Value = dte
                End With
            End If
        Next cel
    End With
Next i

Application.Calculation = xlCalculationAutomatic
Application.ScreenUpdating = True

End Sub
Reply With Quote
 



Similar Threads
Thread Thread Starter Forum Replies Last Post
Need Help Creating a Macro help creating macro tingker Word VBA 4 01-08-2015 08:58 PM
Need Help Creating a Macro Need Help Creating Macro rsrasc Word VBA 1 10-22-2014 03:09 PM
Need Help Creating a Macro Need Help Creating Macro rsrasc Word VBA 4 03-28-2014 01:31 PM
Creating a MACRO Nikb3522 Word VBA 0 10-21-2010 05:55 PM
creating macro steveb Word VBA 0 08-14-2010 01:29 AM

Other Forums: Access Forums

All times are GMT -7. The time now is 01:11 PM.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2025, vBulletin Solutions Inc.
Search Engine Optimisation provided by DragonByte SEO (Lite) - vBulletin Mods & Addons Copyright © 2025 DragonByte Technologies Ltd.
MSOfficeForums.com is not affiliated with Microsoft