I created a macro that doesn't allow values in both the B and C columns of an Excel sheet. I want to make an exception to that formula by allowing cells with the names DayShift or AfterShift.
I created this:
If ActiveCell.Name = "DayShift" Or ActiveCell.Name = "AfterShift" Then
But it doesn't seem to work and just makes other cells e...
So I am creating an excel report from an access database. So this is done in access VBA.
Here is my code:
Public Sub ExportActiveSheet()
'irrelevant data
'get the info
ExcelSheet.Range("A3").CopyFromRecordset rs
Set rs = Nothing
End Sub
so now, as you can see.. my recordset gets copied to a range starting from A3. ...
Hello
I am trying to generate word documents using the mail merge feature in Microsoft Word. To be as clear as possible my dream would be to:
(1) Place all values for all documents to be created in one excel document
(2) Use Word to create a template by selecting the above excel file as the data sheet
(3) Run a macro that would use th...
Let's say I want to program a VBA code in an external program that opens an Excel file, runs a macro, saves (and say yes to any pop up windows), and close Excel. Is it possible to do so? If so, how would I go about implementing it?
...
Hi,
I am creating a form using Excel. The form will be populated upon creation from outside data, but there will be room for users to enter (but not remove info). I need to have repeating tables. I have created my own version of repeating tables( not using Excel's concept of "table") and I have hyperlinks at the bottom of each table t...
I have a userform that allows the user to select customers from a combobox; when a customer is selected, the customer's offices (office name, city, state, address) populate a listview in Report mode. I would like the user to then be able to select (click on) a row in the listview, which triggers code that populates the office-related co...
VBA - The user selects a number from a combobox (1-50) and it is assigned as a variable. I now want to program a function which selects columns BA to a column to the left whatever value the user selected (I.E. from AV:BA where AV is the variable column). I have the variable the user slects as a string (dim var as string). Your help would...
I have a few cells that schedule a list of employees depending on a start time. (In this case, the start time is indicated by the cell named 'Time'.)
=CONCATENATE(TEXT(Time,"h:mm AM/PM")&" - "&TEXT(Time+TIME(10,30,0),"h:mm AM/PM"))
It works fine but now I want to implement a feature that will allow the user to specify how long the shi...
Hi There,
I am trying to expand a range of Hexadecimal numbers. For example I have on column K ... 1880 and column L ...188A my range is 1880-188A When I expand the Range, starting On column M I get 1880 1881 1882 1883 1884 1885 1886 etc etc.
From one of the posting I copied and changed the VBA script to fit my case... and it works ....
I am writing a Macro that requires me to get the average of the values in a column with an unknown number of rows. I use this to get the number of the last row:
Dim lastRow As Long
lastRow = ActiveSheet.UsedRange.SpecialCells(xlCellTypeLastCell).Row
That works. What doesn't work is when I try to use it here:
Range("B2").Select
Activ...
Hi,
it's hard to describe.
I have some columns, say three:
10 20 20
20 22 24
24 24 26
What I like to get is:
10 XX XX
20 20 20
XX 22 XX
24 24 24
XX XX 26
where XX is an empty cell.
Is there a way to get this?
Bye,
Thomas
...
All I'm trying to do is figure out how to change the cell in one worksheet to that of another when the one in the other is double clicked.
In my second worksheet, I have the following code set up:
Private Sub Worksheet_BeforeDoubleClick(ByVal Target As Range, Cancel As Boolean)
End Sub
My question would be what's the code to chan...
I'm having a hard time explaining this one. The following function is being used as a worksheet formula. A value of "empty" simply means that the cell was empty and, therefore, there is no value. Given the values {empty, empty, 0.8, 0.2}, the following function is sometimes returning off the wall values like 5.55111512312578E-17. In ...
I just came to know that macros in Word/Excel/PowerPoint can be programmed. That is awesome because I've a Word document with 70 tables for styling.
I'm a programmer but I don't know VB, VBA or VB .NET. I'm confused with these three. I'm familiar with .NET programming using C#. Now I want to write new macros. Where should I get started?...
Is there a way to get around having to type in a filename when sending a document to Adobe PDF printers? My code is:
Application.ActivePrinter = "Adobe PDF on Ne01:"
MyWorkbook.PrintOut From:=1, To:=3, Copies:=2, Collate:=True
This works except that it prompts me for a filename. Would rather find a way to fix this without installing a...
I recorded a macro to print an excel sheet when the button is pressed. But I want to specify the printer that it automatically prints to rather than give the user a choice. I'm also printing to a PDF so is there a way I can choose where I print to?
This is what I have so far:
Sub Publish()
'
' Publish Macro
' Macro recorded...
I have a legacy Excel 2007 Template that has hardcoded Ms Access MDB path in the VBA code used to connect to the Access tables and save, retrieve data.
I migrated the MS Access Database over to SQL Server with Integrated Authentication for the Excel 2007 Template Users.
My question is, What is the Recommend Way / Best Practice for stor...
I have a excel workbook consisting of 3 sheets. One sheet name is 'importeddata' in which 10 columns exist starting from b5 to k1000(b5:k5 is the heading of the columns). Another sheet name is 'Main Form' in which 10 columns exist starting from b5:K1000.
Now i want to put 'column (c6:c1000) and column (g6:g1000)of the importedata sheet d...
Hi,
I'd like to copy (or move) a worksheet from one workbook to another workbook with Powershell.
I had done this before and cant remember how. I think I used CopyTo() funtion.
Just to get started.
$missing = [System.Type]::missing
$excel = New-Object -Com Excel.Application
$wb1 = $excel.Workbooks.Add($missing)
$wb2 = $excel.Workboo...
Hi
In my excel sheet1 i have 2 combo box...
1)When i open the excel the 2 combox has
to fill
2)if i select one value in one combo box
the corressponding should populate in the second combo box
...