formula/code/vba

Vishaal

Active Member
Joined
Mar 16, 2019
Messages
261
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
1,001
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
261
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
1,001
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
261
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
1,001
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
261
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,081,513
Messages
5,359,226
Members
400,521
Latest member
smarty1995

Some videos you may like

This Week's Hot Topics

  • VBA (Userform)
    Hi All, I just would like to know why my code isn't working. Here is my VBA code: [CODE=vba]Private Sub OKButton_Click() Dim i As Integer...
  • List box that changes fill color
    Hello, I have gone through so many pages trying to figure this out. I have a 2020 calendar that depending on the day needs to have a certain...
  • Remove duplicates and retain one. Cross-linked cases
    Hi all I ran out of google keywords to use and still couldn't find a reference how to achieve the results of a single count. It would be great if...
  • VBA Copy and Paste With Duplicates
    Hello All, I'm in need of some input. My VBA skills are sub-par at best. I've assembled this code from basic research and it works but is...
  • Macro
    is it possible for a macro to run if the active cell value is different to the value above it
  • IF DATE and TIME
    I currently use this to check if date has passed but i also need to set a time on it too. Is it possible? [CODE=vba]=IF(B:B>TODAY(),"Not...
Top