Urgent - Macro Programming Help Need

  • Thread starter Thread starter Akram_MIM
  • Start date Start date
A

Akram_MIM

I am basically new to programming

Therefore, could any one help me to setup a macro to copy daily Cell
Range K10 to K139 from one Daily Cost file to master Cost file's next
available empty Cell. Example today I copy K10:K139 from Daily cost
file to master cost file C10:C139 and tomorrow it needs to copy to
D10:D139 so on automatically

How do I can write a macro to do the above task.

I will highly appreciate your assistance on this matter.
 
I am assuming you mean worksheets here.

Set wsDaily = Worklsheets("Daily Cost File")
Set wsMaster = Worksheets("Master Cost File")

With wsMaster
cLastCol = .Cells(10,.Columns.Count).End(xlToLeft).Column
If cLastCol = 1 Then
cLastCol = 3 ' first run goes to C
Else
cLastCol = cLastCol + 1 ' next column
End If
wsDaily.Range("K10:K139").Copy Destination:= _
wsMaster.Cells(10,cLastCol)
End With

--

HTH

RP
(remove nothere from the email address if mailing direct)
 

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

Similar Threads


Back
Top