I can't get excel to do what I want after creating this VBA script:
LastColumn = ActiveSheet.UsedRange.Columns(ActiveSheet.UsedRange.Columns.Count).Columns
For n = 63 To 63
For i = n To n
I am getting a run time error 13 in my code between the **. Can anyone out there see why? For some reason the code will run and do what I want, but then spit out the error. Any help will be appreciated.
Dim i As Integer
Im having some issues with my code below. It works fine on majority of rows, but towards the end, it's having some issues.
What my code does is this:
- if values of cells (i,j) and cells (i+r,j), basically 1 cell and the cell below it are the same, then they merge and other columns...
I have a macro which I wrote from watching a couple of YouTube videos, it works however, I would like to add the company logo at the bottom of the email, the image is saved in W:\company\logo.jpg. My codes are as follows:
On Error Resume Next
Dim o As...
I have come across a code which am having hard time with. I need the userform information to be entered into another sheet, which is not working. I need the Macro to update the table with new/edit previous information.
' Keyboard Shortcut: Ctrl+g
Public Sub GoalSeeker()
For i = 3 To 187
cells(i, "AG").GoalSeek Goal:=0.15, ChangingCell:=cells(i, "AF")
cells(i, "AF") = WorksheetFunction.Round(cells(i, "AF"), 2)
cells(i, "AF") < 0 = 0
Hello: I have a formula in a CurrentSheet that is looping through data looking at the headers of a data table (data_table) in the same workbook for index and match. That code works fine and is below. However, I need to make it refer to another data table in another workbook for the data. That...
Hello: I have part of a macro that needs to clean up cells and replace the bad data with the good data. I'm using a loop nested if else, but is there a more efficient way? This looks cumbersome. Any help would be appreciated . Thank you!
Dim i As Long
Hello: I have the following formula that I need to replicate down a column. When I paste it, it works fine. But when I try to put it into a loop, I can't seem to make it work. The failing loop is below.
The Formula: =Cells(i, 5).Formula = "=INDEX('Temp...
Hello: I need a sub to input last month's date into a column of data and then hard code the date. The only solution I came up with is below, but I'm wondering why it's not creating a circular reference. Thank you! I'm sure it has something to do with equivalency, but I'm still new!
Hello: I have the following data. I want col A to equal the value of the first cell to its right, but retain it in a formula. For example the successful result in A2 would be "=B2" not "1". The following code gets the value in col A but it's a value, not a formula. Thank you!
not sure if this fits into the excel category but its what im using with ADODB
Application.ScreenUpdating = False
var1 = Sheets("Sheet2").Range("A1")
Set cnn = CreateObject("ADODB.Connection")
Rw = 2
For i = 2 To Rw
Wondering if someone could lead me to an alternative. The below Loop deletes the row if a cell condition (Text "Test") is located in Column J, also looking to delete the 3 rows above. Coincidentally found a similar request on the forum yesterday, however unsure how to amend.
Morning, I have a code which should be deleting a selection of cells if the word does not start with LMK or DUB or ORK but it seems to delete it even if it does, can anyone spot the error of my ways please ?
For i = LastRow To IRStartCell Step -1
K = Cells(i, 18)
If K <> "DUB*" Or K <>...
i am going through a 100 rows and adding the numbers up together, it sums to a 100. Once it reaches 70, 85, 100, different actions are taken.
This is pretty much a manual conditional format.
For i = 2 To lastRow
endChecker = range("D" & i).Value + endChecker...
I have been reading all posts but cant come across the answer.
I am using this code:
Dim fpath As String
Dim i, xc As Integer
For i = 1 To ActiveSheet.UsedRange.Rows.Count
xc = Range("XFD" & i).End(x1ToLeft).Column
If xc = 1 Then
I'm only new to VBA and have been able to get some pretty cool stuff done to my database for my transport company.
I am trying to copy data based from my data sheet "Data" to report sheet "Pre Alert" based on 2 criteria's selected on "Pre Alert" sheet.
The code have is below. When...
' Option Explicit
Dim MyRunTimer As Date
col headers A = Date B = Time C = Message
MyRunTimer = Now + TimeValue("00:00:10")
Dim i As Variant, t As Date, s As String
If Range("D1") <> "" Then
For i = 2 To [A65536].End(xlUp).Row
Thanks in advance for any suggestions for which feedback will be given.
This code runs through a series of tabs and wherever it sees an error, it takes that line and places it in the "Error.Items" sheet. Why is it duplicating each error? I guess I could write code at the end to remove the...
This is my current code:
On Error Resume Next
Dim o As Outlook.Application
Set o = New Outlook.Application
Dim omail As Outlook.MailItem
Dim Signature As String
Dim i As Long
For i = 2 To Range("A10000").End(xlUp).Row
Set omail =...