musicman715
New Member
- Joined
- Jul 15, 2011
- Messages
- 45
Windows("Invoice - Event By Department.xls").Activate<?xml:namespace prefix = o ns = "urn:schemas-microsoft-comfficeffice" /><o></o>
Range("A18:O18").Select<o></o>
Selection.Copy<o></o>
<o> </o>
Above is the code to copy the info from cells A18-O18 in my invoice…following this above code is my code to paste that info into my data sheet. What I need is this: sometimes the info in A18-O18 is in A19-O19 because the address line in my invoice has 5 lines instead of 4 when I export this invoice to excel. I need the VBA to tell excel: “ If info is in A18-o18 copy that info, but if info is in A19-O19, copy that info instead, then proceed onto the following “pasting” command in my code.” I think I can use an if else command, but I’m not exactly sure of all the syntax.<o></o>
Any help is greatly appreciated.<o></o>
Thanks Musicman715<o></o>
Range("A18:O18").Select<o></o>
Selection.Copy<o></o>
<o> </o>
Above is the code to copy the info from cells A18-O18 in my invoice…following this above code is my code to paste that info into my data sheet. What I need is this: sometimes the info in A18-O18 is in A19-O19 because the address line in my invoice has 5 lines instead of 4 when I export this invoice to excel. I need the VBA to tell excel: “ If info is in A18-o18 copy that info, but if info is in A19-O19, copy that info instead, then proceed onto the following “pasting” command in my code.” I think I can use an if else command, but I’m not exactly sure of all the syntax.<o></o>
Any help is greatly appreciated.<o></o>
Thanks Musicman715<o></o>