Cần giúp đỡ về sự chuyển đổi dữ liệu sạng văn bản sang dạng giá trị? (1 người xem)

Liên hệ QC

Người dùng đang xem chủ đề này

quykiemsau

Thành viên chính thức
Tham gia
4/8/10
Bài viết
66
Được thích
0
Xin chào GPE!
Tôi đang vướng mắc một vấn đề sau:
Hiện tại phần mềm chấm công của công ty tôi lhi xuất dữ liệu sang file excel nó toàn dữ liệu dạng text không thể tính toán được.
Xin hỏi có cách nào chuyển nó thành giá trị để có thể tính toán được không ạ?

Cụ thể như file đính kèm.

Rất mong nhận được giúp đỡ của GPE! Xin cảm ơn rất nhiều!
 

File đính kèm

Xin chào GPE!
Tôi đang vướng mắc một vấn đề sau:
Hiện tại phần mềm chấm công của công ty tôi lhi xuất dữ liệu sang file excel nó toàn dữ liệu dạng text không thể tính toán được.
Xin hỏi có cách nào chuyển nó thành giá trị để có thể tính toán được không ạ?
Cụ thể như file đính kèm.
Rất mong nhận được giúp đỡ của GPE! Xin cảm ơn rất nhiều!
Bạn chọn toàn bộ bảng tính, chuyển sang định dạng "General" sau đó tính toán bình thường
 
Upvote 0
Bạn chọn toàn bộ bảng tính, chuyển sang định dạng "General" sau đó tính toán bình thường

Tks Bạn rất nhiều! Cái này mình cũng biết là như vậy. Nhưng thực ra giá trị của nó cũng không phải là giá ttrij thực bạn à! MÀ nó vẫn là dạng Text.
Trừ khi ta kích vào từng ô 1 sau đó bấm Enter. Như vậy quá lâu.. hix!
 
Upvote 0
Click vào D10 cho thấy hình vuông có dấu chấm than màu đen xuất hiện bên trái và chọn vùng D10 đến AA52 giữ phím Shift, xong rê chuột vào hình vuông có dấu chấm than nó sẽ xuất hiện mũi tên màu đen, click chuột vào mũi tên màu đen sẽ có danh sách xổ xuống, click chọn Convert to number thử xem.
 
Lần chỉnh sửa cuối:
Upvote 0
Ôi! Nhầm quên không kiểm tra lại! Bạn ơi vẫn chưa được bạn à! Các giá trị thời gian vẫn là dạng text.. hix! ^^
 
Upvote 0
Em không rành về VBA lắm!
Anh thử bôi đen từng cột thời gian đó xong rồi thử cách này xem:
Data > Text to columns...
Trong cửa sổ hiện ra, chọn Fixed with trong phần Separator Options > Finish
Nhưng mà hình như anh phải làm từng cột hay sao ý. hì hì
 
Upvote 0
Lần đầu Em đưa code của mình lên diễn đàn .. hix hix

ĐÂY! CODE CỦA EM ĐÂY! --=0

HTML:
Sub hihihoho()
    Range("E7:E52").Select
    Selection.TextToColumns Destination:=Range("E7:E52"), DataType:=xlFixedWidth, _
        FieldInfo:=Array(0, 1), TrailingMinusNumbers:=True
    Range("F7:F52").Select
    Selection.TextToColumns Destination:=Range("F7:F52"), DataType:=xlFixedWidth, _
        FieldInfo:=Array(0, 1), TrailingMinusNumbers:=True
    Range("H7:H52").Select
    Selection.TextToColumns Destination:=Range("H7:H52"), DataType:=xlFixedWidth, _
        FieldInfo:=Array(0, 1), TrailingMinusNumbers:=True
    Range("I7:I52").Select
    Selection.TextToColumns Destination:=Range("I7:I52"), DataType:=xlFixedWidth, _
        FieldInfo:=Array(0, 1), TrailingMinusNumbers:=True
    Range("K7:K52").Select
    Selection.TextToColumns Destination:=Range("K7:K52"), DataType:=xlFixedWidth, _
        FieldInfo:=Array(0, 1), TrailingMinusNumbers:=True
    Range("L7:L52").Select
    Selection.TextToColumns Destination:=Range("L7:L52"), DataType:=xlFixedWidth, _
        FieldInfo:=Array(0, 1), TrailingMinusNumbers:=True
    Range("N7:N52").Select
    Selection.TextToColumns Destination:=Range("N7:N52"), DataType:=xlFixedWidth, _
        FieldInfo:=Array(0, 1), TrailingMinusNumbers:=True
    Range("O7:O52").Select
    Selection.TextToColumns Destination:=Range("O7:O52"), DataType:=xlFixedWidth, _
        FieldInfo:=Array(0, 1), TrailingMinusNumbers:=True
    Range("Q7:Q52").Select
    Selection.TextToColumns Destination:=Range("Q7:Q52"), DataType:=xlFixedWidth, _
        FieldInfo:=Array(0, 1), TrailingMinusNumbers:=True
    Range("R7:R52").Select
    Selection.TextToColumns Destination:=Range("R7:R52"), DataType:=xlFixedWidth, _
        FieldInfo:=Array(0, 1), TrailingMinusNumbers:=True
    Range("T7:T52").Select
    Selection.TextToColumns Destination:=Range("T7:T52"), DataType:=xlFixedWidth, _
        FieldInfo:=Array(0, 1), TrailingMinusNumbers:=True
    Range("U7:U52").Select
    Selection.TextToColumns Destination:=Range("U7:U52"), DataType:=xlFixedWidth, _
        FieldInfo:=Array(0, 1), TrailingMinusNumbers:=True
    Range("W7:W52").Select
    Selection.TextToColumns Destination:=Range("W7:W52"), DataType:=xlFixedWidth, _
        FieldInfo:=Array(0, 1), TrailingMinusNumbers:=True
    Range("X7:X52").Select
    Selection.TextToColumns Destination:=Range("X7:X52"), DataType:=xlFixedWidth, _
        FieldInfo:=Array(0, 1), TrailingMinusNumbers:=True
    Range("Z7:Z52").Select
    Selection.TextToColumns Destination:=Range("Z7:Z52"), DataType:=xlFixedWidth, _
        FieldInfo:=Array(0, 1), TrailingMinusNumbers:=True
    Range("AA7:AA52").Select
    Selection.TextToColumns Destination:=Range("AA7:AA52"), DataType:=xlFixedWidth, _
        FieldInfo:=Array(0, 1), TrailingMinusNumbers:=True
End Sub

XẤU HỔ QUÁ MẤT THÔI ! :))
 

File đính kèm

Upvote 0
^^
Chưa xét đến code của bạn thế nào nhưng tinh thần của bạn thật tuyệt vời.
Nếu bạn mà gửi code ghi không thì có thể rút gọn thêm tí xíu để nhìn cho đỡ ghê, :D
ví dụ:
HTML:
Sub hihihoho()
    Range("E7:E52").TextToColumns Destination:=Range("E7:E52"), DataType:=xlFixedWidth, _
        FieldInfo:=Array(0, 1), TrailingMinusNumbers:=True
    Range("F7:F52").TextToColumns Destination:=Range("F7:F52"), DataType:=xlFixedWidth, _
        FieldInfo:=Array(0, 1), TrailingMinusNumbers:=True
    Range("H7:H52").TextToColumns Destination:=Range("H7:H52"), DataType:=xlFixedWidth, _
        FieldInfo:=Array(0, 1), TrailingMinusNumbers:=True
    Range("I7:I52").TextToColumns Destination:=Range("I7:I52"), DataType:=xlFixedWidth, _
        FieldInfo:=Array(0, 1), TrailingMinusNumbers:=True
    Range("K7:K52").TextToColumns Destination:=Range("K7:K52"), DataType:=xlFixedWidth, _
        FieldInfo:=Array(0, 1), TrailingMinusNumbers:=True
    Range("L7:L52").TextToColumns Destination:=Range("L7:L52"), DataType:=xlFixedWidth, _
        FieldInfo:=Array(0, 1), TrailingMinusNumbers:=True
    Range("N7:N52").TextToColumns Destination:=Range("N7:N52"), DataType:=xlFixedWidth, _
        FieldInfo:=Array(0, 1), TrailingMinusNumbers:=True
    Range("O7:O52").TextToColumns Destination:=Range("O7:O52"), DataType:=xlFixedWidth, _
        FieldInfo:=Array(0, 1), TrailingMinusNumbers:=True
    Range("Q7:Q52").TextToColumns Destination:=Range("Q7:Q52"), DataType:=xlFixedWidth, _
        FieldInfo:=Array(0, 1), TrailingMinusNumbers:=True
    Range("R7:R52").TextToColumns Destination:=Range("R7:R52"), DataType:=xlFixedWidth, _
        FieldInfo:=Array(0, 1), TrailingMinusNumbers:=True
    Range("T7:T52").TextToColumns Destination:=Range("T7:T52"), DataType:=xlFixedWidth, _
        FieldInfo:=Array(0, 1), TrailingMinusNumbers:=True
    Range("U7:U52").TextToColumns Destination:=Range("U7:U52"), DataType:=xlFixedWidth, _
        FieldInfo:=Array(0, 1), TrailingMinusNumbers:=True
    Range("W7:W52").TextToColumns Destination:=Range("W7:W52"), DataType:=xlFixedWidth, _
        FieldInfo:=Array(0, 1), TrailingMinusNumbers:=True
    Range("X7:X52").TextToColumns Destination:=Range("X7:X52"), DataType:=xlFixedWidth, _
        FieldInfo:=Array(0, 1), TrailingMinusNumbers:=True
    Range("Z7:Z52").TextToColumns Destination:=Range("Z7:Z52"), DataType:=xlFixedWidth, _
        FieldInfo:=Array(0, 1), TrailingMinusNumbers:=True
    Range("AA7:AA52").TextToColumns Destination:=Range("AA7:AA52"), DataType:=xlFixedWidth, _
        FieldInfo:=Array(0, 1), TrailingMinusNumbers:=True
End Sub
 
Upvote 0
Mở file ra. Save As file CSV (comma separated values). Mở file CVS ra, copy vào trở lại file ban đầu. Chỉnh sửa màu mè phông phiếc.
 
Upvote 0
Xin chào GPE!
Tôi đang vướng mắc một vấn đề sau:
Hiện tại phần mềm chấm công của công ty tôi lhi xuất dữ liệu sang file excel nó toàn dữ liệu dạng text không thể tính toán được.
Xin hỏi có cách nào chuyển nó thành giá trị để có thể tính toán được không ạ?

Cụ thể như file đính kèm.

Rất mong nhận được giúp đỡ của GPE! Xin cảm ơn rất nhiều!

Chạy code này:
Mã:
Sub test()
    With Sheets("Sheet1").UsedRange
        .NumberFormat = "General"
        .Value = .Value
    End With
End Sub
 
Upvote 0

Bài viết mới nhất

Back
Top Bottom