Can you see an issue with this code please

ipbr21054

Well-known Member
Joined
Nov 16, 2010
Messages
5,738
Office Version
  1. 2007
Platform
  1. Windows
Hi,
I have a code which works well & correct,it then calls the macro below.

Code:
Sub sheettolist()'
' sheettolist Macro
Sheets("HONDA SHEET").Range("A21:G21").Interior.ColorIndex = 6
Sheets("HONDA SHEET").Range("A21:G21").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
Sheets("HONDA LIST").Range("A4").Select
ActiveWorkbook.Save
Sheets("HONDA SHEET").Range("A13").Select
End Sub

This should copy the data from HONDA SHEET to HONDA LIST
Select cell A4
Then return back to HONDA SHEET
Where cell A13 is then selected.

On each sheet i have a working code where once you select a cell that row will be Blue & the selected cell Green.
So in the code above i would like cell A4 slected on HONDA LIST so when i then return to it that row & cell is colored as mentioned.

With Sheets("HONDA LIST").Range("A4").Select in the code it returns a message,
Run time error 1004
Select class range of methos class failed.

So if i remove Sheets("HONDA LIST").Range("A4").Select,
I receive no errors.
The cell A4 on HONDA LIST is selected BUT the row/cell color is not updated & the next row down has the row/cell colored.

Many thanks
 
Once the data from HONDA SHEET to HONDA LIST has taken place that same row should be blue & the cell A4 should be green,this happens with another code on the sheet.
The i am taken back to HONDA SHEET and cell A13 is selected

Whats not happening it the color change & cell selection.
 
Upvote 0

Excel Facts

Test for Multiple Conditions in IF?
Use AND(test, test, test, test) or OR(test, test, test, ...) as the logical_test argument of IF.
Ok so i got it to work now using the mess below

Code:
Sub sheettolist()                                    '' sheettolist Macro
    Application.ScreenUpdating = False
    With ActiveWorkbook
        .Sheets("HONDA SHEET").Range("A21:G21").Interior.ColorIndex = 6
        .Sheets("HONDA SHEET").Range("A21:G21").Copy
        .Sheets("HONDA LIST").Activate
        .Sheets("HONDA LIST").Range("A4").Insert Shift:=xlDown
        Application.CutCopyMode = False
        .Sheets("HONDA LIST").Range("A4").Characters(Start:=10, Length:=1).Font.ColorIndex = 3
        ActiveSheet.Range("A5").Select
        ActiveSheet.Range("A4").Select
        .Sheets("HONDA LIST").Activate
        ActiveSheet.Range("A4").Select
        .Sheets("HONDA SHEET").Activate
        ActiveSheet.Range("A13").Select
        .Save
    End With
    Application.ScreenUpdating = True
End Sub
 
Upvote 0

Forum statistics

Threads
1,223,911
Messages
6,175,337
Members
452,636
Latest member
laura12345

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