logo
down
shadow

paste values are hardcoded in macro


paste values are hardcoded in macro

By : rbit314
Date : November 19 2020, 01:01 AM
To fix the issue you can do Firstly my desired result is to concatenate two cells to create a hyperlink. One cell has the web address of our ticket management system and the other has the ticket number. The two cells exist on the DrillDown sheet of a double clicked Pivot Table, the source data of which does have the hyperlink already, but it doesn't pull through to the drilldown sheet and as I've read on multiple forums it's not possible to make it pull through. , Things can be simplified a bit:
code :
Sub CreateHyperlink()
'
' CreateHyperlink Macro
'

' Move everything four columns to the right
Columns("A:D").Select
Selection.Insert Shift:=xlToRight, CopyOrigin:=xlFormatFromLeftOrAbove

' Create the hyperlink by adding the last 5 characters of the ticket number and then use the full ticket number. The full ticket number is in cell E3
Range("C3").FormulaR1C1 = _
     "=HYPERLINK(CONCATENATE(""http://test.analytics.com/workspace/379/item/"",RIGHT(RC[2],5)),RC[2])
Range("C4").Select
Columns("C:C").EntireColumn.AutoFit

End Sub


Share : facebook icon twitter icon
Macro to copy a worksheet and paste into a new file using paste special values

Macro to copy a worksheet and paste into a new file using paste special values


By : El Rebelde
Date : March 29 2020, 07:55 AM
this one helps. If you are looking only to copy cell values and nothing else, a shortcut would be something like:
code :
dim rgSource as range
dim rgTarget as range

set rgSource = ActiveSheet.UsedRange  ' cells containing values on src sheet
set rgTarget = Workbooks.Add.Worksheets(1).Cells(1,1) ' new range on target sheet
set rgTarget = rgTarget.Resize(rgSource.Rows.Count, rgSource.Columns.Count) ' same sz

rgTarget = rgSource.Value  ' copies values into the target range on the other sheet
Macro to copy and paste as values only the active cells

Macro to copy and paste as values only the active cells


By : user3436081
Date : March 29 2020, 07:55 AM
will be helpful for those in need Not sure I follow your question exactly but here is what I think your asking for.
You can loop through each cell that is selected and then set the cell value to it's current value which effectively removes all formulas. There are other ways to do this but I think this best answers your specific question.
code :
Sub removeFormula()
    For Each cell In Selection
        cell.Value = cell.Value
    Next cell
End Sub
My VBA macro is working but I need it to paste as values

My VBA macro is working but I need it to paste as values


By : Khyati Malhan
Date : March 29 2020, 07:55 AM
To fix the issue you can do As a general rule you can always record your steps with "record macro". This is an excellent way to help you learn the ins and outs of VBA.
If you don't see the developer tab on your excel ribbon you can learn how to show it HERE.
VBA - Run Macro from Word to paste values into Excel

VBA - Run Macro from Word to paste values into Excel


By : Shi Jerry
Date : March 29 2020, 07:55 AM
it fixes the issue Your Selection is referring to the current application. To refer to the Excel application you need to use ED.Selection. But it is a bad idea to rely on Activate and Select anyway.
I suggest you change your code to:
code :
Sub Transfer()

    Dim WD As Document
    Dim ED As Excel.Application
    Dim EDS As Excel.Workbook

    Set WD = ActiveDocument
    Set ED = CreateObject("excel.application")
    ED.Visible = True 
    'Avoid "Activate"
    Set EDS = ED.Workbooks.Open(FileName:= _
             "C:\Users\Documents\AppealData.xlsx")

    WD.FormFields("AppNum").Copy
    'Avoid "Activate" and "Select" and "Selection"
    '"Paste" is a worksheet Method, use "PasteSpecial" for a Range
    'Use "xlPasteValues" to avoid formatting issues
    EDS.Sheets("Sheet1").Range("A1").PasteSpecial Excel.xlPasteValues
End Sub
Excel macro paste just values

Excel macro paste just values


By : swathi v.s
Date : March 29 2020, 07:55 AM
seems to work fine I written macro which copy date from one sheet to other. , Use:
code :
Sheet1.Cells(i, 3).Copy
Sheet2.Cells(erow, 1).PasteSpecial xlPasteValues
Sheet2.Cells(erow, 1).Value = Sheet1.Cells(i, 3).Value
shadow
Privacy Policy - Terms - Contact Us © ourworld-yourmove.org