Quantcast
Channel: VBForums
Viewing all articles
Browse latest Browse all 15552

Excel - VBA: Code is generating unexpected numbers (0)

$
0
0
Hi All,

I really need help on this 🙁

This code is adding extra zeros in column D for no apparent reason; What part of the code is doing that?

Code: https://pastebin.com/ccpqPJdz

Code:

last = Range("B" & Rows.Count).End(xlUp).Row
   
 'Insert 3 columns on left. Add information in Row 1, add data in column D.
 Columns("A:A").Select
 Selection.Insert Shift:=xlToRight
 Columns("A:A").Select
 Selection.Insert Shift:=xlToRight
 Columns("A:A").Select
 Selection.Insert Shift:=xlToRight
 Columns("E:E").Copy Destination:=Columns("C:C")
 Columns("E:E").Select
 Selection.Delete Shift:=xlToLeft
 Range("D2:D2" & last).Select
 Selection.SpecialCells(xlCellTypeBlanks).Select
 Selection.FormulaR1C1 = "=R[-1]C[6]"
 Columns("D").Copy
 Columns("D").PasteSpecial xlPasteValues
 Range("D1") = Time
 Range("D1").NumberFormat = "h:mm:ss"

Input:
Name:  input.jpg
Views: 42
Size:  17.9 KB

Output:
Name:  output.png
Views: 43
Size:  3.8 KB
Attached Images
  

Viewing all articles
Browse latest Browse all 15552

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>