Ben Lanier
Ben Lanier

Reputation: 13

Convert Integer to Date issue

I as developing a program that imported cash from Yahoo Finance onto another Excel spreadsheet. Everything was working fine, then I wrote another function that uploaded the name of the business, and now suddenly the cash value is being displayed as a date and I am very confused.

  'WB1.Cells(i, 3) = CDate(WB2.Range("G3"))
    WB1.Cells(i, 4) = WB2.Range("G7")
  WB1.Cells(i, 4) = CLng(WB1.Cells(i, 4))

Upvotes: 0

Views: 42

Answers (1)

MatthewD
MatthewD

Reputation: 6791

Set the numberFromat of the cell

WB1.Cells(i, 4).NumberFormat = "$#,##0.00"

Upvotes: 3

Related Questions