Activating a Specific Cell in Excel Using VBA Results to Error 400

0 votes

I'm simply gathering all the text on the first sheet with red font colour and storing it in an array. After that, I want to switch to a different sheet and open a particular cell where I want to initially enter the values from my prior array. However, the section where I selected a cell on the other page produced an error code of 400. Having previously utilized it, I am certain that it is correct. I'm not sure whether there's any manipulation in my code at the beginning that could have an impact on that.

Sub isFontRed()
    Cells(2, 1).Select

    Dim missingJobs(0 To 600) As String
    Dim size As Integer, row As Integer, col As Integer, jobIndex As Integer
    jobIndex = 0

    For row = 2 To 10 '600
        For col = 1 To 2
            If (CStr(Cells(row, col).Font.ColorIndex) = 3) Then
               missingJobs(jobIndex) = Cells(row, col)
               jobIndex = jobIndex + 1
           End If
       Next col
    Next row

    Dim jobs As String
    jobs = ""
    For i = 0 To UBound(missingJobs) - 1
        jobs = jobs + missingJobs(i) + ", "
    Next i

    Worksheets("New Jobs in New Folder").Activate
    Cells(4, 2).Activate
End Sub
Dec 26, 2022 in Others by Kithuzzz
• 38,020 points
471 views

1 answer to this question.

0 votes
I think you trying to select cells(4, 2). I don't think you can 'activate' a cell like you can a worksheet. Try Cells(4, 2).Select instead.
answered Dec 27, 2022 by narikkadan
• 63,720 points

Related Questions In Others

0 votes
1 answer
0 votes
1 answer

How to stick an embedded document in a specific cell of an excel

Solution Select the documents (you can use the ...READ MORE

answered Oct 18, 2022 in Others by narikkadan
• 63,720 points
653 views
0 votes
1 answer

Add a shape to a specific cell in Excel

When you use SORT() or data->sort on ...READ MORE

answered Oct 24, 2022 in Others by narikkadan
• 63,720 points
1,323 views
0 votes
1 answer

Excel VBA : HOW TO PRINT THE TEXT IN A CELL (like Wrap Text)

Use a LineFeed character to create a ...READ MORE

answered Oct 27, 2022 in Others by narikkadan
• 63,720 points
988 views
0 votes
1 answer

Retrieve epay.info Balance with VBA and Excel

This code should log you in, provided ...READ MORE

answered Sep 5, 2018 in Blockchain by digger
• 26,740 points
1,079 views
0 votes
1 answer

How to load file to Excel Power query from SFTP site

Currently, I don't think there is a ...READ MORE

answered Dec 3, 2018 in Power BI by Upasana
• 8,620 points
3,495 views
0 votes
1 answer

Using VBA Excel to create a gramatically correct list

The Excel AND function is a logical ...READ MORE

answered Feb 9, 2022 in Others by gaurav
• 23,260 points
803 views
0 votes
2 answers

How to copy a formula horizontally within a table using Excel VBA?

Hi so basically, create an adjacent column ...READ MORE

answered Feb 16, 2022 in Others by Edureka
• 13,690 points
976 views
0 votes
1 answer
0 votes
1 answer

Excel-VBA - How to identify Target range (more than 1 cell) is deleted in a Worksheet_Change function?

You misunderstand the purpose of the function ...READ MORE

answered Sep 23, 2022 in Others by narikkadan
• 63,720 points
3,537 views
webinar REGISTER FOR FREE WEBINAR X
REGISTER NOW
webinar_success Thank you for registering Join Edureka Meetup community for 100+ Free Webinars each month JOIN MEETUP GROUP