I have a database I created in excel. I use VBA to open a file and copy the data then paste it into the database. When i later plot the data and view it i have an issue with "0" values in the excel cells that should be blank, empty, null whatever you want to call it.
This piece of code selects the range i want and then i want to set the range to "" so that "0" doesn't appear when i pull the data up to plot from the database.
Code:
ThisWorkbook.Worksheets("SIM_Database_Entry").Range("B13:B198").Find("").Select
WedgeAddress = ActiveCell.Address
ThisWorkbook.Worksheets("SIM_Database_Entry").Range("X198").Select
CGAddress = ActiveCell.Address
ActiveWorkbook.ActiveSheet.Range(WedgeAddress, CGAddress).Select
'%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
'up to this point works fine and does what i want it to do
'%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
Selection.Value = ""
i have tried many options i researched
Selection.Clear
Selection.ClearContents
Selection.Value = ""
Selection.Value = VBNullString
Selection.Value = Null
Selection.Value = Empty
None of these seem to work or do what i want. I also use an IF statement in the same database on a calculated cell and use "" to set values to nothing and this works perfectly with the database and not returning 0...this is empty no value
Thanks for any suggestions!
This piece of code selects the range i want and then i want to set the range to "" so that "0" doesn't appear when i pull the data up to plot from the database.
Code:
ThisWorkbook.Worksheets("SIM_Database_Entry").Range("B13:B198").Find("").Select
WedgeAddress = ActiveCell.Address
ThisWorkbook.Worksheets("SIM_Database_Entry").Range("X198").Select
CGAddress = ActiveCell.Address
ActiveWorkbook.ActiveSheet.Range(WedgeAddress, CGAddress).Select
'%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
'up to this point works fine and does what i want it to do
'%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
Selection.Value = ""
i have tried many options i researched
Selection.Clear
Selection.ClearContents
Selection.Value = ""
Selection.Value = VBNullString
Selection.Value = Null
Selection.Value = Empty
None of these seem to work or do what i want. I also use an IF statement in the same database on a calculated cell and use "" to set values to nothing and this works perfectly with the database and not returning 0...this is empty no value
Thanks for any suggestions!