NoS
Member
- Joined
- Jan 17, 2013
- Messages
- 835
- Reaction score
- 0
- Points
- 16
- Location
- British Columbia
- Excel Version(s)
- Excel 2010
Yes, but the CPreport you posted, column "B" is not all text.Could it be possible that because these originally are data dumps from SAP that they are formatted as text and not numbers
Some are numbers and those were the only ones the previous code was recognizing. The rest are text and all have an invisible leading and trailing chr160.
Column "I" of the DataSchedule.xlsm are 10 numeric characters formatted as text with no invisible characters.
Try adding
Code:
Dim order as Range
and changing the part setting the source to
Code:
'set where to find it in CPreport
With srcWB
src_lr = .Sheets("Sheet1").Cells(Rows.Count, 2).End(xlUp).Row
Set src = srcWB.Sheets("Sheet1").Range("B4:B" & src_lr)
End With
'doctor the data
For Each order In src
order.Value = Replace(order.Value, Chr(160), "") * 1
Next order
If that doesn't work you'll need to supply what you're really working with.