drowningman
New Member
- Joined
- Mar 27, 2008
- Messages
- 14
Hi guys. In a work spreadsheet, I have worksheet that I dump tons of information into and another worksheet that I pull select information into a rebate template I've already set up. I've created a macro to pull that information with a click of a button and while it works great, it can only pull one line at a time. What do I need to add to this script to have it pull all the rows that have information on it? Here's what I currently have ... thanks in advance. Please let me know if you need any additional information (note that var12 is a +2 on purpose and is the only var that needs to jump two columns over).
Sub Upload()
Sheets("Dump Sheet").Select
var1 = Range("B5").Value
var2 = Range("C5").Value
var3 = Range("D5").Value
var4 = Range("E5").Value
var5 = Range("F5").Value
var6 = Range("G5").Value
var7 = Range("H5").Value
var8 = Range("I5").Value
var9 = Range("J5").Value
var10 = Range("K5").Value
var11 = Range("L5").Value
var12 = Range("M5").Value
var13 = Range("N5").Value
var14 = Range("O5").Value
var15 = Range("P5").Value
var16 = Range("Q5").Value
var17 = Range("R5").Value
var18 = Range("S5").Value
Sheets("Rebate Formulas").Select
Range("B5").Select
Do While ActiveCell.Value <> ""
ActiveCell.Offset(1, 1).Select
Loop
ActiveCell.Offset(0, x) = var1
x = x + 1
ActiveCell.Offset(0, x).Value = var2
x = x + 1
ActiveCell.Offset(0, x).Value = var3
x = x + 1
ActiveCell.Offset(0, x).Value = var4
x = x + 1
ActiveCell.Offset(0, x).Value = var5
x = x + 1
ActiveCell.Offset(0, x).Value = var6
x = x + 1
ActiveCell.Offset(0, x).Value = var7
x = x + 1
ActiveCell.Offset(0, x).Value = var8
x = x + 1
ActiveCell.Offset(0, x).Value = var9
x = x + 1
ActiveCell.Offset(0, x).Value = var10
x = x + 1
ActiveCell.Offset(0, x).Value = var11
x = x + 1
ActiveCell.Offset(0, x).Value = var12
x = x + 2
ActiveCell.Offset(0, x).Value = var13
x = x + 1
ActiveCell.Offset(0, x).Value = var14
x = x + 1
ActiveCell.Offset(0, x).Value = var15
x = x + 1
ActiveCell.Offset(0, x).Value = var16
x = x + 1
ActiveCell.Offset(0, x).Value = var17
x = x + 1
ActiveCell.Offset(0, x).Value = var18
x = x + 1
End Sub
Sub Upload()
Sheets("Dump Sheet").Select
var1 = Range("B5").Value
var2 = Range("C5").Value
var3 = Range("D5").Value
var4 = Range("E5").Value
var5 = Range("F5").Value
var6 = Range("G5").Value
var7 = Range("H5").Value
var8 = Range("I5").Value
var9 = Range("J5").Value
var10 = Range("K5").Value
var11 = Range("L5").Value
var12 = Range("M5").Value
var13 = Range("N5").Value
var14 = Range("O5").Value
var15 = Range("P5").Value
var16 = Range("Q5").Value
var17 = Range("R5").Value
var18 = Range("S5").Value
Sheets("Rebate Formulas").Select
Range("B5").Select
Do While ActiveCell.Value <> ""
ActiveCell.Offset(1, 1).Select
Loop
ActiveCell.Offset(0, x) = var1
x = x + 1
ActiveCell.Offset(0, x).Value = var2
x = x + 1
ActiveCell.Offset(0, x).Value = var3
x = x + 1
ActiveCell.Offset(0, x).Value = var4
x = x + 1
ActiveCell.Offset(0, x).Value = var5
x = x + 1
ActiveCell.Offset(0, x).Value = var6
x = x + 1
ActiveCell.Offset(0, x).Value = var7
x = x + 1
ActiveCell.Offset(0, x).Value = var8
x = x + 1
ActiveCell.Offset(0, x).Value = var9
x = x + 1
ActiveCell.Offset(0, x).Value = var10
x = x + 1
ActiveCell.Offset(0, x).Value = var11
x = x + 1
ActiveCell.Offset(0, x).Value = var12
x = x + 2
ActiveCell.Offset(0, x).Value = var13
x = x + 1
ActiveCell.Offset(0, x).Value = var14
x = x + 1
ActiveCell.Offset(0, x).Value = var15
x = x + 1
ActiveCell.Offset(0, x).Value = var16
x = x + 1
ActiveCell.Offset(0, x).Value = var17
x = x + 1
ActiveCell.Offset(0, x).Value = var18
x = x + 1
End Sub