View Single Post
  #5   Report Post  
denny
 
Posts: n/a
Default

I think I've got it! Post it must mean, tell you what my macro says, so you
can debug it. I wanted it to paste a formula line by line so that when I
wrote a receipt all I would have to do would be put in an item number and it
would feed me the item description, price, tax, etc. (without cluttering the
receipt by having formulas sitting there that were not being used). I
discovered my biggest problem was that I needed to consider every starting
point as an "a1" not some other letter. I hope that makes sense.
This is my formula to copy:
=VLOOKUP($D5,myin,2,FALSE) 1 =VLOOKUP($D5,myin,3,FALSE)*G5
=VLOOKUP($D5,myin,4,FALSE)

This is my macro: (I think it is working)
Sub CopyPaste()
'
' CopyPaste Macro
' Copy and Paste Formulas Line by Line
'
' Keyboard Shortcut: Ctrl+p
'
Application.Goto Reference:="R5C5"
ActiveCell.Range("a1:e1").Select
Selection.Copy
Selection.End(xlDown).Select
Selection.End(xlDown).Select
ActiveCell.Offset(1, 0).Range("a1").Select
ActiveSheet.Paste
Application.CutCopyMode = False
ActiveCell.Offset(0, -1).Range("a1").Select
End Sub