Can someone assist in dividing a cell by all cells in range. Something like this.
I have lr as follows:
Dim lr As Long: lr = Range("B" & Rows.Count).End(xlUp).Row
range("D2:D" & lr) = "C2/sum("C2:C" & lr)"
When using the first code, the code output the results required. however, when I want to make the code dynamic to find the last row, the output is (0) zero. Can someone explain what I'm doing wrong and offer a solution.
Thank you kindly
Dim i As Long
LRow = Range("A" &...
I'm using the code below and today's date is pre-populated in the Input box. Is there a way to make it today() - 7 days?
Application.ScreenUpdating = FalseApplication.DisplayAlerts = False
Dim LR As Long
LR = ActiveSheet.Range("A" & Rows.Count).End(xlUp).Row...
If you put the following hyperlinks into cells I2:I10 and then run the code below it is failing on the line:
Set details = JSONConvert.ParseJson(.responseText)("details")
With the runtime error code in the title of this thread.
Any ideas please?
I have the following links in G2:G10
In A Double-Click Event Macro I'm Having Syntax issues in getting the 2nd code line to "take"
Lr = Range("C" & Rows.Count).End(xlUp).Row
If Not Intersect(Target, Range("N & Target.Row & ":P" & LR)) Is Nothing Then
What's the proper syntax?
I have a file that consistently reports "Excel was able to open the file by repairing or removing the unreadable content". I have narrowed it down to a single macro which runs, and it seems to only cause "damage" when the file is opened on a different computer (on the same LAN) from which the...
I created a script to created three separate equations in columns, P, Q and R. I have it working up to autofilling down for P and Q, but am now getting a Run time 1004 error when it tries to auto fill down from R2 to wherever the bottom would be. Any suggestions would be helpful!
Hi Experts - i have a problem with my code. I have a conditional formatting rules i set that highlights the cell if it has a value of FALSE or DUPLICATE. It works right after i set the rules however the rules get deleted after running below code. Do the rules get deleted by any of the codes...
Hi Experts - Good day! I have below code which is always the beginning of my process. I wan't to clear the table of any data for sheets Check and SRPT. The code is working as expected everytime there's data under the columns i'm trying to delete. However, if there's no data under the headers...
I need this to delete every row where there is not a "B" in column 9 (Column i) Starting in Row 5 down
'Delete Rows that dont have a B in the Type column
Dim LR As Long, j As Long
LR = Range("C" & Rows.Count).End(xlUp).Row
For j = LR To 1 Step -1
If Range("i" &...
I have limited programming knowledge but I manage to créate this code below. Rows from sheet1 are copied in sheet2 if column E is "YES". This Works but only If I run the Macro in sheet 1.Anybody knows why?
I am trying to copy the formula in the active cell in column F to the bottom line of column F based on the last cell with data in column J. When I use the below code it copies it all the way down column F past the last cell in J.
Am I forgetting something in this code?
LastRowF = Range("F" &...
Hi, I have a (what I thought was) very simple line of code that is causing my macro to error if the macro is run from a different sheet to the sheet that the data is being worked on. I originally defined it within a block of With Sheets... code, but when it errored I defined the line itself but...
I have a vba code set up but am not able to select a different sheet in the unsaved workbook. I get "subscript out of range error"
The code is
. Press the Enter key to open the contact card." style="unicode-bidi: embed; direction: ltr; text-align: left; user-select: text...
I have been using this below code.
It basically copies the value from cell H5 everytime it changes to the first empty cell in column N.
The problem is I need to copy H5 and I5 when H5 changes.
I have tried adding AND like this:
...Then sh.Range("N" & Range("N" & Rows.Count).End(xlUp).Row +...
I have 1 filtered data that already been processed(1st set). with my 2nd set code, it overwrites current(1st set) value. Is there any way to make my code only process visible cell.
Dim x As String
Dim LastRow As Long
LastRow = Range("D" &...
As per the title, I am having an issue with iterating through folders and files where the path exceeds the charater limits. Below is my code:
Dim FileSystem As Object
Dim HostFolder As String
HostFolder = Sheet1.Range("F16").Value
If HostFolder = "" Then
I would like to search column "D" and whenever it finds the word "Gone" delete that row.
Why does this not work?
It runs but does nothing.
'Application.ScreenUpdating = False
For LR = Range("D" & Rows.Count).End(xlUp).Row To 2 Step -1
If Range("D" & LR).Value...
I need to create a variable length report. I am able to get the code to work but I need to add 20 'blank' rows at the end of the data set for additional write in data. Now I can copy the last row 20 times but can't get how to clear those rows as I need the rows to have the borders.