Hello,
I'm new to VBA and having trouble deleting a row. Error line = ws2.Rows(x).Delete
Including the whole code below. Any ideas?
Set ws1 = ThisWorkbook.Sheets("Ansatt")
Set ws2 = ThisWorkbook.Sheets("TabellAnsatt")
ws1.Range("Eksport").Copy
If...
I have the following code , but cannot get message "subscript out of range
Const C As String = 2018.2019
sub Copy_Data
Workbooks("Sales Comms." & d & ".xls").ActiveSheet.Range("D2").PasteSpecial Paste:=xlPasteValues
Workbooks("Sales Comms." & d & ".xls").ActiveSheet.Range("D2").PasteSpecial...
Hi,
I am working trying to create a macro that will populate different worksheets based on a value in the dropdown selected in the tab called "List". I need the Macro to loop through all the values in the dropdown and populate different tabs based on the value. The name of the tab corresponds...
Hi All,
I have used VBA to paste a range below the last active cell in the paste to good success, but for some reason I cannot seem to get it to work in this instance.
I have two named ranges that I am trying to move into one single column, but rather than building a combined list, the second...
Dear All,
Please find below mentioned VBA code.I tried to take printout of the employees name in certificate.Name are mentioned in workers sheet and certificate format is in Worker_Certificate sheet.
Private Sub CommandButton1_Click()
x = 2
Sheets("Workers").Range("B" & x).Copy...
Here's the code I have. The first code box is to perform a check that Cell X in Workbook1 equals Cell Y in Workbook2, if successful it will continue to my second code box where it will pull the data from the designated cells and then paste it in the row where the active cell is currently...
Hello,
This code was working previously. I added some similar code that links to another document above the place where the error is occurring and now a Run-time error '1004': Cannot use that command on overlapping selections appears in this line of code:
sh3.Range(Left(rowsToDelete...
Hello everyone,
I am completely new to VBA, but the process I now need to perform is forcing me into learning about it.
Currently I'm working on a summary workbook that needs to pull data from multiple different workbooks. All of the workbooks I need to pull from are formatted the exact same...
I am using the code to move data from 1 worksheet to another. Right now the code skips to the next worksheet if there is an error (the error is when there is no data to move).
How can I modify the code to skip to End Sub and not go to next worksheet if there is an error WITHOUT getting the...
Not sure what is wrong with my code but it is erroring outon one line, I am not sure why the select command is not working?
My code
Option Explicit
'--------------------------------------------------------
'--- Updates ByCostCenter Sheet...
Hi all,
I'm a bit of a rookie and can't figure out how to add another IF to this code below.
Sheets("CORE").Range("A1") is referring to a date.. and if that date can't be found in the ActiveSheet.Range("A1:A100"), I would like it to do nothing, no next.
I would also like to not use...
In a previous thread I was adviced to get rid of .Activate, .Select, and .Selection - as these both slow down code and is known to cause flickering screen. And then to put Application.ScreenUpdating = False at the top of my code.
Through several other threads and a lot of help, I've changed...
Hi,
I am trying to populate and clear fields using a check box.
I have written something long and stupid that will not work. Can someone help me.
This is what I have:
If Sheets("MISC DATA").Range("C18").Value = "TRUE" Then
Range("F5:N5").Select
Selection.Copy...
I have a project I am creating for work but i am unable to do it as my VBA keeps saying code too long. let me try to explain first what i need. there are a total of 5 sheets of data. i want to be able to copy paste a particular area of info from one place to another via entering data(in this...
I have a project I am creating for work but i am unable to do it as my VBA keeps saying code too long. let me try to explain first what i need. there are a total of 5 sheets of data. i want to be able to copy paste a particular area of info from one place to another via entering data(in this...
This chunk is not moving from ws to ws like you would expect. I don't know why. Any ideas?
For Each ws In wkbk_LI.Worksheets
c = ActiveSheet.Name
wkbk_LI.Worksheets(c).Cells.ClearContents
'Dependents
Set rng = wkbk_D.Worksheets(c).Range("A6")
Set rng = Range(rng...
I have a macro, and it is only pulling the one macro to print. The formula is not continuing onto the next one. I'm newer at writing code. I've done this both ways using the Call function and just adding the subs into once macro....
Sub RunAll()
FW
bonbon
End Sub
Sub ShocoChoc()...
Hi, I'm struggling to fix this error. I'm trying to copy a cell value from one worksheet to another within the same workbook. here is the code:
Sub try()
Worksheets("Temp_Provider").Range("BZ2").Copy
Worksheets("ManualTemplate").Range("K3").PasteSpecial Paste:=xlPasteValues (this is where...
Can anyone help me with this code? The range is only selecting 2 cells down from the active cell each time, instead of to the last cell with data.
Selection.Copy
ActiveCell.Offset(1, 0).Range("A1", Range("A1").End(xlDown)).Select
Selection.PasteSpecial Paste:=xlPasteValues...
I've been using the following code for a few years to flip spreadsheet data around without issue. Recently however I received a large data set (about 5X larger than those I typically work with and the macro eventually runs out of resources and stops. Typically this runs instantly. I've tried...
We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel
Which adblocker are you using?
Disable AdBlock
Follow these easy steps to disable AdBlock
1)Click on the icon in the browser’s toolbar. 2)Click on the icon in the browser’s toolbar. 2)Click on the "Pause on this site" option.
Go back
Disable AdBlock Plus
Follow these easy steps to disable AdBlock Plus
1)Click on the icon in the browser’s toolbar. 2)Click on the toggle to disable it for "mrexcel.com".
Go back
Disable uBlock Origin
Follow these easy steps to disable uBlock Origin
1)Click on the icon in the browser’s toolbar. 2)Click on the "Power" button. 3)Click on the "Refresh" button.
Go back
Disable uBlock
Follow these easy steps to disable uBlock
1)Click on the icon in the browser’s toolbar. 2)Click on the "Power" button. 3)Click on the "Refresh" button.