VBA

%3CLINGO-SUB%20id%3D%22lingo-sub-2408992%22%20slang%3D%22en-US%22%3EVBA%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2408992%22%20slang%3D%22en-US%22%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%3CFONT%20size%3D%223%22%3EI%26nbsp%3B%20have%20some%20simple%20code%3A%3C%2FFONT%3E%3C%2FP%3E%3CP%3E%3CFONT%20size%3D%221%202%203%204%205%206%207%22%3ESub%20Macro5()%3C%2FFONT%3E%3CBR%20%2F%3E%3CFONT%20size%3D%221%202%203%204%205%206%207%22%3E'%3C%2FFONT%3E%3CBR%20%2F%3E%3CFONT%20size%3D%221%202%203%204%205%206%207%22%3E'%20Macro5%20Macro%3C%2FFONT%3E%3CBR%20%2F%3E%3CFONT%20size%3D%221%202%203%204%205%206%207%22%3E'%3C%2FFONT%3E%3C%2FP%3E%3CP%3E%3CFONT%20size%3D%221%202%203%204%205%206%207%22%3E'%3C%2FFONT%3E%3CBR%20%2F%3E%3CFONT%20size%3D%221%202%203%204%205%206%207%22%3ESheets(%22Assays%22).Select%3C%2FFONT%3E%3CBR%20%2F%3E%3CFONT%20size%3D%221%202%203%204%205%206%207%22%3ERows(%222%3A2%22).Select%3C%2FFONT%3E%3CBR%20%2F%3E%3CFONT%20size%3D%221%202%203%204%205%206%207%22%3ESelection.Insert%20Shift%3A%3DxlDown%2C%20CopyOrigin%3A%3DxlFormatFromLeftOrAbove%3C%2FFONT%3E%3CBR%20%2F%3E%3CFONT%20size%3D%221%202%203%204%205%206%207%22%3ESheets(%22Assay%20Entry%22).Select%3C%2FFONT%3E%3CBR%20%2F%3E%3CFONT%20size%3D%221%202%203%204%205%206%207%22%3ERange(%22C4%3AC7%22).Select%3C%2FFONT%3E%3CBR%20%2F%3E%3CFONT%20size%3D%221%202%203%204%205%206%207%22%3ESelection.Copy%3C%2FFONT%3E%3CBR%20%2F%3E%3CFONT%20size%3D%221%202%203%204%205%206%207%22%3ESheets(%22Assays%22).Select%3C%2FFONT%3E%3CBR%20%2F%3E%3CFONT%20size%3D%221%202%203%204%205%206%207%22%3ERange(%22A2%22).Select%3C%2FFONT%3E%3CBR%20%2F%3E%3CFONT%20size%3D%221%202%203%204%205%206%207%22%3ESelection.PasteSpecial%20Paste%3A%3DxlPasteValues%2C%20Operation%3A%3DxlNone%2C%20SkipBlanks%3A%3D%20_%3C%2FFONT%3E%3CBR%20%2F%3E%3CFONT%20size%3D%221%202%203%204%205%206%207%22%3EFalse%2C%20Transpose%3A%3DTrue%3C%2FFONT%3E%3CBR%20%2F%3E%3CFONT%20size%3D%221%202%203%204%205%206%207%22%3ESheets(%22Assay%20Entry%22).Select%3C%2FFONT%3E%3CBR%20%2F%3E%3CFONT%20size%3D%221%202%203%204%205%206%207%22%3ERange(%22E8%3AE14%22).Select%3C%2FFONT%3E%3CBR%20%2F%3E%3CFONT%20size%3D%221%202%203%204%205%206%207%22%3ESelection.Copy%3C%2FFONT%3E%3CBR%20%2F%3E%3CFONT%20size%3D%221%202%203%204%205%206%207%22%3ESheets(%22Assays%22).Select%3C%2FFONT%3E%3CBR%20%2F%3E%3CFONT%20size%3D%221%202%203%204%205%206%207%22%3ERange(%22E2%22).Select%3C%2FFONT%3E%3CBR%20%2F%3E%3CFONT%20size%3D%221%202%203%204%205%206%207%22%3ESelection.PasteSpecial%20Paste%3A%3DxlPasteValues%2C%20Operation%3A%3DxlNone%2C%20SkipBlanks%3A%3D%20_%3C%2FFONT%3E%3CBR%20%2F%3E%3CFONT%20size%3D%221%202%203%204%205%206%207%22%3EFalse%2C%20Transpose%3A%3DTrue%3C%2FFONT%3E%3CBR%20%2F%3E%3CFONT%20size%3D%221%202%203%204%205%206%207%22%3ESheets(%22Assay%20Entry%22).Select%3C%2FFONT%3E%3CBR%20%2F%3E%3CFONT%20size%3D%221%202%203%204%205%206%207%22%3ERange(%22C15%3AC16%22).Select%3C%2FFONT%3E%3CBR%20%2F%3E%3CFONT%20size%3D%221%202%203%204%205%206%207%22%3ESelection.Copy%3C%2FFONT%3E%3CBR%20%2F%3E%3CFONT%20size%3D%221%202%203%204%205%206%207%22%3ESheets(%22Assays%22).Select%3C%2FFONT%3E%3CBR%20%2F%3E%3CFONT%20size%3D%221%202%203%204%205%206%207%22%3ERange(%22L2%22).Select%3C%2FFONT%3E%3CBR%20%2F%3E%3CFONT%20size%3D%221%202%203%204%205%206%207%22%3ESelection.PasteSpecial%20Paste%3A%3DxlPasteValues%2C%20Operation%3A%3DxlNone%2C%20SkipBlanks%3A%3D%20_%3C%2FFONT%3E%3CBR%20%2F%3E%3CFONT%20size%3D%221%202%203%204%205%206%207%22%3EFalse%2C%20Transpose%3A%3DTrue%3C%2FFONT%3E%3CBR%20%2F%3E%3CFONT%20size%3D%221%202%203%204%205%206%207%22%3ESheets(%22Assay%20Entry%22).Select%3C%2FFONT%3E%3CBR%20%2F%3E%3CFONT%20size%3D%221%202%203%204%205%206%207%22%3ERange(%22C4%3AC16%22).Select%3C%2FFONT%3E%3CBR%20%2F%3E%3CFONT%20size%3D%221%202%203%204%205%206%207%22%3ESelection.ClearContents%3C%2FFONT%3E%3CBR%20%2F%3E%3CFONT%20size%3D%221%202%203%204%205%206%207%22%3ERange(%22C4%22).Select%3C%2FFONT%3E%3CBR%20%2F%3E%3CFONT%20size%3D%221%202%203%204%205%206%207%22%3EEnd%20Sub%3C%2FFONT%3E%3C%2FP%3E%3CP%3E%3CFONT%20size%3D%223%22%3EThat%20runs%20a%20Macro%20that%20enters%20information%20from%20one%20sheet%20to%20the%20next.%20It%20copies%20everything%20over%2C%20but%20when%20I%20run%20it%20again%20it%20omits%20some%20of%20the%20information%20that%20was%20previously%20transferred.%3C%2FFONT%3E%3C%2FP%3E%3CTABLE%20width%3D%22846%22%3E%3CTBODY%3E%3CTR%3E%3CTD%20width%3D%2268%22%3E6%2F1%2F201%3C%2FTD%3E%3CTD%20width%3D%2261%22%3E123%3C%2FTD%3E%3CTD%20width%3D%2258%22%3E456%3C%2FTD%3E%3CTD%20width%3D%22125%22%3EB%3C%2FTD%3E%3CTD%20width%3D%2273%22%3E50.76%25%3C%2FTD%3E%3CTD%20width%3D%2257%22%3E1.27%25%3C%2FTD%3E%3CTD%20width%3D%2257%22%3E0.51%25%3C%2FTD%3E%3CTD%20width%3D%2257%22%3E1.02%25%3C%2FTD%3E%3CTD%20width%3D%2263%22%3E0.76%25%3C%2FTD%3E%3CTD%20width%3D%2265%22%3E5.08%25%3C%2FTD%3E%3CTD%20width%3D%2263%22%3E20.30%25%3C%2FTD%3E%3CTD%20width%3D%2232%22%3E4%3C%2FTD%3E%3CTD%20width%3D%2267%22%3E4%3C%2FTD%3E%3C%2FTR%3E%3CTR%3E%3CTD%3E5%2F28%2F2021%3C%2FTD%3E%3CTD%3E47196%3C%2FTD%3E%3CTD%3E131738%3C%2FTD%3E%3CTD%3EA%3C%2FTD%3E%3CTD%3E%26nbsp%3B%3C%2FTD%3E%3CTD%3E%26nbsp%3B%3C%2FTD%3E%3CTD%3E%26nbsp%3B%3C%2FTD%3E%3CTD%3E%26nbsp%3B%3C%2FTD%3E%3CTD%3E%26nbsp%3B%3C%2FTD%3E%3CTD%3E%26nbsp%3B%3C%2FTD%3E%3CTD%3E%26nbsp%3B%3C%2FTD%3E%3CTD%3E4%3C%2FTD%3E%3CTD%3E4%3C%2FTD%3E%3C%2FTR%3E%3C%2FTBODY%3E%3C%2FTABLE%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%3CFONT%20size%3D%223%22%3EAnybody%20have%20any%20ideas%3F%3C%2FFONT%3E%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-LABS%20id%3D%22lingo-labs-2408992%22%20slang%3D%22en-US%22%3E%3CLINGO-LABEL%3EExcel%3C%2FLINGO-LABEL%3E%3CLINGO-LABEL%3EFormulas%20and%20Functions%3C%2FLINGO-LABEL%3E%3CLINGO-LABEL%3EMacros%20and%20VBA%3C%2FLINGO-LABEL%3E%3C%2FLINGO-LABS%3E
New Contributor

 

I  have some simple code:

Sub Macro5()
'
' Macro5 Macro
'

'
Sheets("Assays").Select
Rows("2:2").Select
Selection.Insert Shift:=xlDown, CopyOrigin:=xlFormatFromLeftOrAbove
Sheets("Assay Entry").Select
Range("C4:C7").Select
Selection.Copy
Sheets("Assays").Select
Range("A2").Select
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks:= _
False, Transpose:=True
Sheets("Assay Entry").Select
Range("E8:E14").Select
Selection.Copy
Sheets("Assays").Select
Range("E2").Select
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks:= _
False, Transpose:=True
Sheets("Assay Entry").Select
Range("C15:C16").Select
Selection.Copy
Sheets("Assays").Select
Range("L2").Select
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks:= _
False, Transpose:=True
Sheets("Assay Entry").Select
Range("C4:C16").Select
Selection.ClearContents
Range("C4").Select
End Sub

That runs a Macro that enters information from one sheet to the next. It copies everything over, but when I run it again it omits some of the information that was previously transferred.

6/1/201123456B50.76%1.27%0.51%1.02%0.76%5.08%20.30%44
5/28/202147196131738A       44

 

Anybody have any ideas?

0 Replies