All cells in code specified alter cell color apart from one

ipbr21054

Well-known Member
Joined
Nov 16, 2010
Messages
5,699
Office Version
  1. 2007
Platform
  1. Windows
Afternoon all,
I am using the code shown below to copy the data from HONDA SHEET A17:G17 to HONDA LIST A4:G4
This happens after i make my selection from a drop list down in cell F17

Code:
Sub sheettolist()'
' sheettolist Macro
Sheets("HONDA SHEET").Range("A17:G17").Copy
Sheets("HONDA LIST").Range("A4").Insert Shift:=xlDown
Application.CutCopyMode = False
Sheets("HONDA LIST").Range("A4").Characters(Start:=10, Length:=1).Font.ColorIndex = 3
ActiveWorkbook.Save
Sheets("HONDA SHEET").Range("A13").Select
End Sub

On the HONDA LIST worksheet is the code shown below which highlights the rows A4;G4 so its more easier for me to see the data within the cells.
Code:
Private Sub SortVinButton_Click()    
    Dim x As Long
    
    Application.ScreenUpdating = False
    
    With Sheets("HONDA LIST")
        If .AutoFilterMode Then .AutoFilterMode = False
        x = .Cells(.Rows.Count, 1).End(xlUp).Row
        
        .Range("A3:G" & x).Sort Key1:=Range("A4"), Order1:=xlAscending, Header:=xlGuess
    
    End With
                      
    ActiveWorkbook.Save
    
    Application.ScreenUpdating = True
    Sheets("HONDA LIST").Range("A4").Select
    
End Sub

The above works well apart from the cell F4 on HONDA LIST worksheet doesnt change color where the other cells in Row 4 do.

Do you see an issue as to why or maybe advise an edit to force it to work.

Many thanks.
 
On the Database, change the change event to this
Code:
Private Sub Worksheet_Change(ByVal Target As Range)
    With Target
        [COLOR=#0000ff]If .Column = 13 Then Exit Sub[/COLOR]
        If .Count = 1 And Not .HasFormula Then
            Application.EnableEvents = False
            .Value = UCase(.Value)
            Application.EnableEvents = True
        End If
    End With
End Sub
In the Honda sheet add the line in blue as shown
Code:
                Application.EnableEvents = False
                .Rows(17).Insert Shift:=xlDown
                .Range("A17:G17").Borders.Weight = xlThin
                .Range("G17").Value = Date
                .Range("A17").Value = UCase(.Range("A13").Value)
                .Range("B17").Select
                .Range("A13").ClearContents
                [COLOR=#0000ff].Range("A17").Characters(Start:=10, Length:=1).Font.ColorIndex = 3[/COLOR]
                Application.EnableEvents = True
 
Upvote 0

Excel Facts

When they said...
When they said you are going to "Excel at life", they meant you "will be doing Excel your whole life".
Glad to help & thanks for the feedback
 
Upvote 0

Forum statistics

Threads
1,223,275
Messages
6,171,123
Members
452,381
Latest member
Nova88

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