sfilename

  1. P

    Ambiguous name error

    Hi I have the code below but I get an ambiguous name error come up please can you help. the error comes on the line below Private Sub Worksheet_Change(ByVal Target As Range) Private Sub Worksheet_Change(ByVal Target As Range) 'This code goes in Book13, amend for book 14 'this...
  2. J

    converting VBA macro code from win7 to MAC

    Hello,I have created a excel VBA macro in windows7 operating system to populate PDF.Macro runs fine i win7 but in MAC operating system it gives error: MakePDF error: 53 file not found: shell32.dll VBAproject. Though On Mac it creates a FDF file. The code is.. ' Write FDF file to disk...
  3. H

    Error On Opening File

    Hi all, I got Run-time error "Sorry, we couldn't find Inventory_SWK - 080319.xlsx. Is it possible it was moved, renamed or deleted?" Below is my code: Dim sFileName As String Dim lRow As Long Dim wb As Workbook sFileName = Dir(ThisWorkbook.Path & "\Inventory_SWK*") Workbooks.Open (sFileName)...
  4. Z

    Use File Obtained From GetOpenFileName

    Just added the top part of code to select file instead of having it hard coded. How do I go about adjusting the 2nd part so I can use it instead of the hard coded file. ChDrive "c:" NewFN = Application.GetOpenFilename(FileFilter:="Excel Files (*.xlsx), *.xlsx", Title:="Please select a file") If...
  5. B

    CSV Export with extra spaces

    Hi, I am exporting to a csv with commas between my fields. My data looks fine in the sheet. When I export it, it puts a space sometimes before, after, or both each comma (looking like this: 4/30/2018 ,UNALOC, 2 , 67.91 ,Aney, David, 6102 , 4 , 133.76). My export code is: Public Sub...
  6. R

    The last workbook created is not closing....

    Hi, The following code goes through the records and saves the workbook as the cell value in the column N. The only problem is the last workbook created is not saving and is not closing. Sub SaveAsString() Dim i As Integer Dim lRow As Integer Dim sPath As String Dim sFileName As String Dim wb...
  7. D

    Run these two macros only when the respective checkbox is checked

    Hello I have two macros (in "this workbook" object in VBA)for which I want to have two checkboxes in a worksheet (each for one macro) And I wanna to run these macro if their respective checkbox is selected in a worksheet. Private Sub Workbook_SheetChange(ByVal Sh As Object, ByVal Target As...
  8. R

    Error 91 using F5, but completes ok from pushbutton

    Hi, After years of coding in other languages I have been asked to "automate" some Excel workbook actions, so this is my one of my first attempts using VBA. One of them is copying the used cells in a couple of worksheets to a new workbook. This VBA code works fine if run by clicking a button...
  9. R

    Placing file name in textbox

    Hello. I have an Excel sheet named DATA and a text button with the word "TEST". I want to assign a macro to that text button that opens a open file dialog, collect the the file name and replace the word "TEST" with the file name. I've tried this:Sub TextBox4_Click() Dim sFileName As String...
  10. M

    exce selection to csv

    Hi everyone, This is my first post so please do not remove my profile in case I did not follow all the posting rules. I am using a VBA script that saves an excel selection as .csv file, my issue is that my code (at the end of this question) returns a .csv file which looks as follows: but...
  11. Pinaceous

    VBA File Import to Another XLSM question

    Hi All, I'm using this code below to have the user import information onto their wook sheet. Working great! Dim sFilename As Variant Dim wsDest As Worksheet ChDrive "S:" ChDir "S:\GROUPS\Depts\ADMIN" sFilename = Application.GetOpenFilename("Excel Files, *.xlsm", ...
  12. N

    Error - macro save as xlxs

    Dear all, it's the first time i'm using a macro in excel and i don't know VBA very well, yet. I need to save all files in some different folders from .dta to .xlxs. I opened the first file and create a new macro in the folder 'PERSONAL.xlsb' and tried with this program: Sub m() Dim...

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