View Single Post
  #5   Report Post  
Posted to microsoft.public.excel.programming
John John is offline
external usenet poster
 
Posts: 2,069
Default How to run this macro

your code does not reference any worksheet / range

see if this does what you want.

Sub LegUpdate()
'
Dim ORG As String
Dim DES As String
Dim Myws As Worksheet

Set Myws = Worksheets("Sheet1") '<< change as required

With Myws

ORG = .Range("c1").Value
DES = .Range("c2").Value

.Range("B5,B29,H5,H29,N5,N29") = ORG


.Range("B6,B28,H6,H28,N6,N28") = DES

End With

End Sub
--
jb


"Paul Lambson" wrote:

I am trying to run this macro to take the value in cells C1 & C2 and
write them in the cells below. When I run this macro nothing happens.
What am i missing?

Sub LegUpdate()
'
Dim ORG As String
Dim DES As String

ORG = c1
DES = c2

B5 = ORG
H5 = ORG
N5 = ORG

B29 = ORG
H29 = ORG
N29 = ORG

B6 = DES
H6 = DES
N6 = DES

B28 = DES
H28 = DES
N26 = DES
'

'
End Sub