Copy one cell via vb
Posted: Thu Jan 03, 2013 3:54 pm
Sorry, I haven't done a search of the forum. I wouldn't even know how to compose a search argument.
I made a quick slice report that has two adjacent columns.
Column C = DBRW($B$1,$A7,"Process Description")
Column D = DBRA("ExpenseProd:}Processes",A7,"Description")
(Basically, I'm moving the values of an attribute to a cube)
I want to copy the values in column D to column C
If I do a single cell manually (copy D, paste as values into C) it works. The value goes into my cube.
I tried recording this as a key stroke macro, but it just replaces the formula in column C, and it doesn't go into my cube.
Here are my two failed attempts:
Attempt 1
Dim MyCell As Range
Set MyCell = ActiveCell
MyCell.Select
Selection.Copy
MyCell.Offset(0, -1).Select
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks:=False, Transpose:=False
MyCell.Offset(1, 0).Select
Attempt 2
Dim MyCell As Range, MyString As String
Set MyCell = ActiveCell
MyString = MyCell.Value
MyCell.Offset(0, -1).Value = MyString
MyCell.Offset(1, 0).Select
I made a quick slice report that has two adjacent columns.
Column C = DBRW($B$1,$A7,"Process Description")
Column D = DBRA("ExpenseProd:}Processes",A7,"Description")
(Basically, I'm moving the values of an attribute to a cube)
I want to copy the values in column D to column C
If I do a single cell manually (copy D, paste as values into C) it works. The value goes into my cube.
I tried recording this as a key stroke macro, but it just replaces the formula in column C, and it doesn't go into my cube.
Here are my two failed attempts:
Attempt 1
Dim MyCell As Range
Set MyCell = ActiveCell
MyCell.Select
Selection.Copy
MyCell.Offset(0, -1).Select
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks:=False, Transpose:=False
MyCell.Offset(1, 0).Select
Attempt 2
Dim MyCell As Range, MyString As String
Set MyCell = ActiveCell
MyString = MyCell.Value
MyCell.Offset(0, -1).Value = MyString
MyCell.Offset(1, 0).Select