Archiving data - VB simplification required!

T

tom300181

!Automated Archiving! - FURTHER HELP REQ'!

--------------------------------------------------------------------------------

I have a sheet that has a variable cell (date b1) and an entry fo
Sales (B3). I also have A6 -> AE6 with numbers 1-31,

I want a formula that will look at B1 and add the contents of B3 to t
A7-AE7 under the date from B1.

Can this be done?

Thanks

Tom

--------------------------------------------------------------------------------
Last edited by tom300181 : Today at 01:41 PM.

tom300181
View Public Profile
Send a private message to tom300181
Find all posts by tom300181
Add tom300181 to Your Buddy List

#2 Today, 11:59 AM
tom300181 is Online:
Registered User Join Date: Mar 2005
Posts: 25

I know have a working macro...........


**************************************************
Sub test()
'
' test Macro
' Macro recorded 01/08/2005 by bailete
'

'
Range("B3:B4").Select
Selection.Copy
one
End Sub

Sub one()

If Range("B1") = 1 Then

Range("A7").Select
ActiveSheet.Paste

Else: two


End If
End Sub



Sub two()
If Range("B1") = 2 Then

Range("B7").Select
ActiveSheet.Paste

Else: three


End If
End Sub

Sub three()
If Range("B1") = 3 Then

Range("C7").Select
ActiveSheet.Paste

Else: four


End If
End Sub
Sub four()
If Range("B1") = 4 Then

Range("D7").Select
ActiveSheet.Paste

Else: five


End If
End Sub

Sub five()
If Range("B1") = 5 Then

Range("E7").Select
ActiveSheet.Paste

Else: six


End If
End Sub

Sub six()

If Range("B1") = 6 Then

Range("F7").Select
ActiveSheet.Paste

Else: seven


End If
End Sub



Sub seven()
If Range("B1") = 7 Then

Range("G7").Select
ActiveSheet.Paste

Else:


End If
End Sub

Sub eight()
If Range("B1") = 8 Then

Range("H7").Select
ActiveSheet.Paste

Else: nine


End If
End Sub
Sub nine()
If Range("B1") = 9 Then

Range("I7").Select
ActiveSheet.Paste

Else: ten


End If
End Sub

Sub ten()
If Range("B1") = 10 Then

Range("J7").Select
ActiveSheet.Paste

Else: eleven


End If
End Sub
Sub eleven()
If Range("B1") = 11 Then

Range("K7").Select
ActiveSheet.Paste

Else: twelve


End If
End Sub
**************************************************

My problem is that this is getting very long and I am sure that a
easier way to do thisw must exist.

Can anyone help?

Thanks

To
 
T

Tom Ogilvy

Sub CopyData
Range("B3:B4").Copy Destination:= _
Range("A7").Offset(0,Range("B1").Value - 1)
end sub
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top