I'm trying to create a method that creates a value in a certain column of the excel sheet. Keep running into the runtime error above on the Sheets.Cells.Value = Cint line. Any idea what could be the problem? Thanks!
For Each Cell In Sheets(tab_name).Range(cell_range)
current_row = Cell.Row
split_cells = Split(Cell.Value, ".")
Sheets(tab_name).Cells(current_row, 58).Value = CInt(split_cells(0))
Next Cell
split_cells = Split(Cell.Value & ".", ".")
...? Thesplit_cells(0)
will still be correct if there is something to split and should work as avbnullstring
if not. – user4039065CInt
- that would either be a subscript error or a type mismatch. Set a breakpoint an test the values ofSheets(tab_name).Cells(current_row, 58)
to see if it's a valid range. – Comintern