Without your sample data it's impossible to determine if this is the only error, however this line is incorrect
Row_count=ws.UsedRange.Columns.count
Based on the name of the variable and the comment on that line it should be
Row_count=ws.UsedRange.Rows.count