code

  1. Jyggalag

    Text to columns issues

    Hi all, I currently have a very messy sheet that looks like this: Essentially, row 1 is the heading, row 2-3 is the results that I want to produce through a text to columns, and rows 24-45 are the data that I currently have. The issue is that my cells have become messed up, so for every...
  2. H

    Which is better line in code for Module

    In Module of my Workbook (coded.xlsm) and for the Worksheet (tab named “ZZZ”) I am using User Defined Function to get outputs in some cells where UDFs are there. 1 line of the code is If Sheets("ZZZ").Range("WA10").Value = "=1" Then GoTo finish End If Should I replace the above lines with...
  3. H

    Want to understand a code line

    I have a code whose 4 lines are: If a(q) > 0 Then findhigh = Format(a(q), "0.00") GoTo finish End If I want to understand, If a(q)<=0 Then WHAT WILL HAPPEN? Will GoTo finish line get ‘activated’? 2nd line will not be activated? i.e. IF the If condition…is not TRUE Then does it works as Else...
  4. H

    Code to count number of cells

    In my Workbook there are numerous Worksheets out of which approximately 30 ws are using ‘Worksheet code’. In ‘ThisWorkbook’ also I am using a macro. In Module, I am using a ‘vba code’ for Worksheet (tab named “ZZZ”) using 'User Defined Function' to get the output in some cells wherever UDF is...
  5. S

    Compare and Copy Data from Columns in One Sheet to Another Sheet

    I am looking for a VBA code/macros that does the following... Compare the data in a cell from Column A from Sheet 1 to the data in a cell in Column B in Sheet 2. If the data values are equal, then I want to take the values in the row from Column D in Sheet 1 and past them into the row in Column...
  6. H

    Revision in code requested to avoid hanging of Excel Workbook

    I am using a Function findhigh as Function findhigh(a As Range, b As Range, c As Range) As String In the code. Then I am finding number of 1s in c Range using y = Application.CountIf(c, 1) Now the code works smoothly when If y >= 3 Then If a(y) = 0 Or a(y) = "" Then GoTo finish If...
  7. M

    Excel Button to Save as PDF

    Hi, i have a button on my spreadsheet to save the sheet as a PDF but i can figure out how to get it to create a copy of the file in excel with the same name and save both that copy and the PDF in the location of where the file original file is saved this is my code currently: Private Sub...
  8. K

    Checking Inequality in-between 2 Cells

    Hi there, For my accounting homework, I need to construct a balance sheet in excel. As you may know, Total Assets should be equal to the sum of Total Liabilities and Equities. At the bottom, I have 2 cells, one of them represents the sum of asset items, whereas the other represents the sum of...
  9. D

    Convert date automatically to “mmm” format

    Hi all, Can I know how to get month in “mmm” format if I have a date in its previous column. For eg: column A contains date in short format. I want column B to show only the month in “mmm” format based on the date in column A. Similarly column C will show only the year in “yyyy” format. How to...
  10. Jyggalag

    Make excel macro refer to other sheet than itself

    Hi all, I currently have this code, which saves my sheet (entitled "Sheet3") as a PDF: Option Explicit Sub SaveFileWithMacro() Dim Path As String Dim fn As String Path = "S:\Path\PDF files\" fn = Range("A63") ActiveSheet.ExportAsFixedFormat Type:=xlTypePDF, Filename:=Path & fn & ".pdf" End...
  11. Jyggalag

    Save excel sheet as PDF (only one sheet)

    Hi all, I currently have a macro that converts my excel sheet into a PDF and saves it in a designated folder. However, I only want it to save the first sheet as a PDF, and ignore my other sheets, which it will not do at the moment. My code looks as follows: Option Explicit Sub...
  12. I

    VBA With Selenium: Extract the Element text (code) Not the webpage data

    I am trying to write a code using Selenium Basic. I am extracting messages from a messaging service. I can extract all the messages using FindElementByClass, however this returns all the messages and does not contain any details of who the message is from. I need the messages returned to the...
  13. R

    Replacing cell contents with the lookup value of that cell

    I'm at a point where i'm bringing in two columns with values (city and county) and i've got a lookup sheet where the value of the state - Say Michigan (or MI) is 45 for example and the county is 13. I'm inputting MI in to the cell but would like for it to somehow reflect 45. I'm wondering if i...
  14. R

    Copy Range To Rows Using VBA Code

    I have the following worksheet that I need to transpose according to the number of occurrence in a column (same name etc) within a specific column (B1) and copy the entire column and its row content on to one new row below. The 2nd occurrence of the same name should start on Column Q in this...
  15. R

    Macro to refresh workbook, clear sheet, refer to path and import columns

    Hi, In my worksheet, I would like to add a macro which does the following at once: 1) refresh the active workbook, 2) clear the contents of a specific worksheet, 3) import columns data from a closed workbook, 4) refer to the path of the closed workbook based on cell data in the open workbook...
  16. Jyggalag

    Write offset formula reference in VBA code

    Hi all, I have this formula: Essentially, when I fill in ANY data or make ANY changes to cell D2, i want the VBA to automatically update the current date/time in cell B1, so I can see the last time I made any update to cell D2. I can do xOffsetColumn = -2 But this will show the date in...
  17. Jyggalag

    Macro to save file as PDF saves full sheet

    Hi all, I have this overview at the moment: If I manually choose to save my file as a PDF, it works fine and I get just 1 page with the overview above. However, I have the following VBA code to save my file as a PDF: Option Explicit Sub SaveFileWithMacro() Dim Path As String Dim fn As...
  18. Jyggalag

    How do you make VBA code run automatically?

    Hi all, I am very new to coding in VBA and am trying to figure out how to make my code run automatically. I want to copy paste values from one cell to another, but nothing happens with my current code, any idea why? Thank you!
  19. Jyggalag

    Make VBA code that posts a cells formula as a value

    Hi all, I currently have the following setup: I have some numbers in column C and D, and I use a simple sum() formula in column B. However, I also want to be able to click on the cells in column B and see the value in the formula bar. But I want to keep the formulas in the meantime. What I...
  20. Jyggalag

    Have formula data appear as text, maybe VBA solution?

    Hi all! I currently have this setup, please note that I have hidden all the nonrelevant columns however: The formula I use is this (thank you @RoryA !) =IFERROR(INDEX(INDIRECT("'"&H504&"'!$U$3:$U$73"),MATCH(1...

We've detected that you are using an adblocker.

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.
Go back
Back
Top