formula/code/vba

Vishaal

Active Member
Joined
Mar 16, 2019
Messages
260
There is any code or vba or formula which can do the following

1. We are copying a data/formula
2. Now we want to paste it as values in a active cell,

My problem is that every time data size is changed so formula/code/vba will work when we use that command/vba/code for paste values on that cell
 

offthelip

Well-known Member
Joined
Dec 23, 2017
Messages
945
I have written my own macro which I store in my personal.xlsb file and I have allocated a short cut key to it. I use Ctrl Q . It does a "pastevalues" into the active cell:
Code:
Sub Pastevalues()
'
' Pastevalues Macro
'
' Keyboard Shortcut: Ctrl+q
'
    Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
        :=False, Transpose:=False
End Sub
 

Vishaal

Active Member
Joined
Mar 16, 2019
Messages
260
No, its not working in my case,

we want paste on next sheet/next workbook, we are not pasting on same sheet and every time data is changed

we want when we copy the data and on next workbook/sheet when we paste it we dont want to select paste special and after that select values, just need a vba/code so that we can paste it without this long process
 

offthelip

Well-known Member
Joined
Dec 23, 2017
Messages
945
Maybe you didn't understand how to use because it will happily paste between workbooks, all it does is do a Pastevalues using a command key.
Try selecting a cell on a workbook type Ctrl C ( i.e copy) then select a new workbook and run the macro it will do a paste value in the new workbook

we want paste on next sheet/next workbook, we are not pasting on same sheet and every time data is changed
this requiremnt is not clear what do you mean by "every time the data is changed"
 
Last edited:

Vishaal

Active Member
Joined
Mar 16, 2019
Messages
260
we have tried again as you told but its not working

I mean i have just copy the sheet 1, A2:C15, now we want to paste it through macro on new workbook on cell d16
now again next day
i have just copy the sheet 1, E15:G20, now we want to paste it through macro on new workbook on cell M20

in the above case your code will work, pls confirm
 

offthelip

Well-known Member
Joined
Dec 23, 2017
Messages
945
works fine for me.
Where have you put the macro? and have you assigned a short cut key to it?
 
Last edited:

Vishaal

Active Member
Joined
Mar 16, 2019
Messages
260
i have copy your code and on macro created a new module and paste it

but it not working after that
 

Forum statistics

Threads
1,077,918
Messages
5,337,167
Members
399,130
Latest member
josevidal

Some videos you may like

This Week's Hot Topics

Top