Daily Macro for 31 days

P

paintbrush

I am having problems with the Macro below. The 6th line is off somehow or
6,7,8,9, being off. Would appreciate any help on the line or any other
problem you see with the Macro.

Sub BuildingSalvage()
'Assuming row Corresponds to date:

'Sub MyMacro()
'Dim x As Integer

'Determine what day it is
x = Format(Date, "d")

Cells(x, "G").Formula = Date
Cells(x, "J").FormulaR1C1 = "=RC[-1]*7"
Cells(x, "K").FormulaR1C1 = "=R[7]C[-5]"
Range("f32").Select
Selection.Copy
Range("K").Select
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone,
SkipBlanks_:=False, Transpose:=False
'Cells(x, "K") = Cells(x, "K").Value
Range("E1:E31").ClearContents

End Sub

Line 6 needs to copy cell F32 and place it in line K at its permanent date.
Using columns A-K in Worksheet.
 
P

Per Jessen

Hi

Range("K") is not a valid cell reference.

Not sure if you want to paste in row x, but maybe this:

Range("K" & x).select

Or better:

Range("F32").Copy
Range("K" & x).PasteSpecial Paste:=xlPasteValues, Operation:=xlNone,
SkipBlanks_:=False, Transpose:=False

Hopes this helps.
....
Per
 
D

Don Guillett

instead of > Range("f32").Select
Selection.Copy
Range("K").Select
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone,
SkipBlanks_:=False, Transpose:=False
try
Cells(x, "K").value = Cells(32, "F").Value

--
Don Guillett
Microsoft MVP Excel
SalesAid Software
(e-mail address removed)
paintbrush said:
I am having problems with the Macro below. The 6th line is off somehow or
6,7,8,9, being off. Would appreciate any help on the line or any other
problem you see with the Macro.

Sub BuildingSalvage()
'Assuming row Corresponds to date:

'Sub MyMacro()
'Dim x As Integer

'Determine what day it is
x = Format(Date, "d")

Cells(x, "G").Formula = Date
Cells(x, "J").FormulaR1C1 = "=RC[-1]*7"
Cells(x, "K").FormulaR1C1 = "=R[7]C[-5]"
Range("f32").Select
Selection.Copy
Range("K").Select
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone,
SkipBlanks_:=False, Transpose:=False
'Cells(x, "K") = Cells(x, "K").Value
Range("E1:E31").ClearContents

End Sub

Line 6 needs to copy cell F32 and place it in line K at its permanent
date.
Using columns A-K in Worksheet.
 
P

paintbrush

Don G this was the best news anyone could find on the internet. You make my
day, no Last 3 week I have been working on this problem without any good
results. I never thought that taking the F32 apart would work. thanks,
thanks, for your help. SG

--
paintbrush


Don Guillett said:
instead of > Range("f32").Select
Selection.Copy
Range("K").Select
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone,
SkipBlanks_:=False, Transpose:=False
try
Cells(x, "K").value = Cells(32, "F").Value

--
Don Guillett
Microsoft MVP Excel
SalesAid Software
(e-mail address removed)
paintbrush said:
I am having problems with the Macro below. The 6th line is off somehow or
6,7,8,9, being off. Would appreciate any help on the line or any other
problem you see with the Macro.

Sub BuildingSalvage()
'Assuming row Corresponds to date:

'Sub MyMacro()
'Dim x As Integer

'Determine what day it is
x = Format(Date, "d")

Cells(x, "G").Formula = Date
Cells(x, "J").FormulaR1C1 = "=RC[-1]*7"
Cells(x, "K").FormulaR1C1 = "=R[7]C[-5]"
Range("f32").Select
Selection.Copy
Range("K").Select
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone,
SkipBlanks_:=False, Transpose:=False
'Cells(x, "K") = Cells(x, "K").Value
Range("E1:E31").ClearContents

End Sub

Line 6 needs to copy cell F32 and place it in line K at its permanent
date.
Using columns A-K in Worksheet.

.
 

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