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,006
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,006
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,006
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,082,278
Messages
5,364,202
Members
400,786
Latest member
ismi88

Some videos you may like

This Week's Hot Topics

  • populate from drop list with multiple tables
    Hi All, i have a drop list that displays data, what i want is when i select one of those from the list to populate text from different tables on...
  • Find list of words from sheet2 in sheet1 before a comma and extract text vba
    Hi Friends, Trying to find the solution on my task. But did not find suitable one to the need. Here is my query and sample file with details...
  • Dynamic Formula entry - VBA code sought
    Hello, really hope one of you experts can help with this - i've spent hours on this and getting no-where. .I have a set of data (more rows than...
  • Listbox Header
    Have a named range called "AccidentsHeader" Within my code I have: [CODE]Private Sub CommandButton1_Click() ListBox1.RowSource =...
  • Complex Heat Map using conditional formatting
    Good day excel world. I have a concern. Below link have a list of countries that carries each country unique data. [URL...
  • Conditional formatting
    Hi good morning, hope you can help me please, I have cells P4:P54 and if this cell is equal to 1 then i want row O to say "Fully Utilised" and to...
Top